Pages and Components in separate assembly

Posted 3 years ago by AndyFraser
0

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:

  1. What class library type should they be - .NET Standard 2.0 or .NET Core 3.1?
  2. How do I get access to the service collection setup in my main Blazor application?
    1. I tried constructor injecting the IServiceProvider into my page code behind but get an "Expected Parameterless Constructor" exception.
  3. 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
An error has occurred. This application may no longer respond until reloaded. Reload 🗙