I want to separate a large development project into smaller projects, so I can manage and build separately. This is so that my team to work on separate parts of a Web application by working on separate projects. I want to have Multiple Visual Studio Blazor Projects Participate in the Same Web Application, so that multiple Visual Studio projects share the same IIS application root directory. I need this because it is easier to manage smaller units of a large Web application, to build each project separately from the other projects (which shortens the build times during development), and to divide a large Web application into logical units and have these units share common resources, such as controls. I want to have a root Blazor project http://localhost/MainWeb, that can use child (subweb) projects http://localhost/MainWeb/subweb
In Blazor Server I think I've found a partial (experimental) solution using "AdditionalAssemblies" directive in "<Router" in App.razor, as stated in this article:
https://digitteck.com/frontend/blazor/blazor-page-in-another-assembly/
Other info here: https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-6.0#route-to-components-from-multiple-assemblies
I've initially created a main project, that is my app only with its main menu which serves only for login and routing purposes, then I've created other projects of type "RazorComponent" (so not a standalone app) containing the single logical unit (for example the customers anagraphical data management) and for the routing to them (managed by the menu in the initial main app) I've used the "AdditionalAssemblies" (as in the above link). This way I register in IIS the main app (as usual) and then distribute in the same folder the dlls created by the single logical units (that are the RazorComponents) generated by the single projects and routed by the main app. I wanted anyway the same behavior requested by the original poster, that is each single logical unit to be seen as a single app site and navigated directly through browser address, but until now this is the only solution I've found to have separated projects for a single application.
© 2022 - 2024 — McMap. All rights reserved.