Hi Ismail,
Perfect, that sounds like what I was looking for ; I'll take a look at those application parts, and run with it for now.
Thank you once again for the feedback & the resources!
Hello,
First off, I'd like to say, great job on the framework. I've learned a lot from playing around with ABP in the past year, and the polish on ABPZero is terrific. Being a newer dev, and coming from the limitations of developing extensions tailored to a particular CMS, I had (and have) a lot to learn about robust design, and ABPZero/Boilerplate and these forums have really helped me to understand the SOLID principles and currently available tools.
On that note, I'm looking for advice on how I could approach a design problem I'm running into, and any direction to how I might approach it, or where I should look to find more info.
The company for which I work is looking to rebuild our "Core"/starter template, this time based on ABPZero. Our main source of projects is creating web apps for research "Studies" for researchers within our company, which are generally non-permanent, and all hosted on our facility's servers. These Studies typically have a lot in common, but each one has customizations related to the type of study, and particular research being done (such as unique forms, different relationships of users to the workflows, etc). Because we frequently have several projects live at any given time (currently, ~20), we want to be able to easily push updates from our Core, when we make updates to make use of newer ABP versions, or bug fixes to the common Core.
A solution I was hoping to try was to have one central repo for the Core, being the ABPZero template & our standard tools (using the ABP Update suggestion posted on github <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/issues/96#issuecomment-268093697">https://github.com/aspnetzero/aspnet-ze ... -268093697</a> ), package each core template project (Mvc, App, EF, etc) as a separate nupkg (on a private nuget feed!), and creating small modules per-Study that would load up the entire application, adding whatever customization a particular Study requires.
Currently, that means I'm embedding the resources & views of the MVC project, and loading the entire MVC app into my smaller web module. However, I'm not sure if this approach is 'best-practice', or even 'okay-practice', and was wondering if instead I should be basing new Studies on the MVC project, and handling updates made to the MVC Core manually for each project. This could be quite time-consuming across the projects we have, though, so I worry about the maintenance required.
Has anyone run into this issue and have some advice or warnings about approaching it this way, or suggestions as to how it could be approached differently? I know it's a bit out-of-scope for support, but any advice would be greatly appreciated!
Thanks!
Ahh ok! It's working now, then, with the views and all? That's great!
No problem, glad to have been of some help! Best of luck with the project!
No problem at all; I've found more than my share of info from other users on the forum, so I'm glad I can start helping out!
The directory browser is a tool that can be enabled in the Startup.Configure method of your .Net Core web app (MS docs)
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles();
app.UseEmbeddedFiles();
app.UseDirectoryBrowser(new DirectoryBrowserOptions
{
FileProvider = EmbeddedFileProvider(typeof(ControllerInYourOtherModule).GetTypeInfo().Assembly,"OtherModule.Web"),
RequestPath = "/TestDirectory"
});
}
After enabling it & firing it up, you can navigate to the URL set in the RequestPath, and you'll get a listing of the embedded resources coming from the specified assembly. Just a heads-up, though: I only did this when trying to figure out how to load the views - so I didn't bother with any security, since I removed the tool before deploying. Make sure to remove it, or add security, before you deploy it anywhere with the Directory Browser on.
Alright, that's really strange. Did you have any luck loading/navigating through the directory browser? It allows you to see what embedded resources are loaded, as well as giving an indication of their routes.
Hmm, that's strange.
The problem I was facing at the time was related to hosting the app under a virtual directory (something that was fixed in an update last year). Aside from that, from what I recall, marking the views/scripts as embedded, creating an EmbeddedResourceSet & adding the appropriate [DependsOn()] attribute to the parent Module's definition was all that was required.
Also, at the time, I was not using the .Net Core version; once I did, I needed to add a line to the Startup.cs class, throwing in:
//... existing code under Configure()
app.UseStaticFiles();//already there
app.UseEmbeddedFiles();//magic!
I also added the following lines directly underneath to be able to inspect what files were correctly embedded, which helped visualize any routing issue I'd had:
//app.UseDirectoryBrowser(new DirectoryBrowserOptions
//{
// FileProvider = new EmbeddedFileProvider(typeof(ControllerInYourOtherModule).GetTypeInfo().Assembly,"OtherModule.Web"),
// RequestPath = "/TestDirectory"
//});
Hello @csbeginner,
Have you marked the .cshtml files as embedded resources in your assembly?
Thanks @alper!
I've been suspecting for a while that both the device and computer need to be on the same WiFi network, but it isn't explicitly stated anywhere in the documentation.
Otherwise, I think I've been doing everything else properly.
Stupid question, but I'm assuming in DebugServerIpAdresses.cs,
public static string Current => LocalhostIp;
//You can configure your computer's IP adress for external access (if Current = LocalhostIp)
private const string LocalhostIp
should be set to the IPv4 of the computer I'm working on, correct?
@ismcagdas,
I downloaded the Start-Host.zip file included in that documentation and changed the destination for the .Web.Host to where the files are stored locally on my computer C:\Users[username]\Documents\CoreTest\CoreTest\src\CoreTest.Web.Host.
Therefore I run .bat file to start the host