Pages and Components in separate assembly
Posted 3 years ago
by AndyFraser
I am starting a new Blazor project that will end up with dozens of pages/components.
I would like to group the pages and components in separate assemblies and reference them via the AdditionalAssemblies of the Router object.
However, I am not sure of a number of things about the satellite assemblies:
- What class library type should they be - .NET Standard 2.0 or .NET Core 3.1?
- How do I get access to the service collection setup in my main Blazor application?
- I tried constructor injecting the IServiceProvider into my page code behind but get an "Expected Parameterless Constructor" exception.
- Instead of adding each assembly as a project reference in my main Blazor app and specifying the assemblies using AdditionalAssemblies, can I search for the satellite assemblies and run-time and load/reference them ?
Any help would be much appreciated.
Andy
Someone is typing...
Post a Reply
You must be logged in to add a new post.
Number of online users: 2