Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blazor pages in multiple projects

I have 3 projects Projection.Server - this contains the host file and startups Projection.Shared - This contains the controllers and pages (class library) Components.Shared - This contains all components to be used throughout the projects (class library)

My question is that i have all my pages within Projection.Shared for that project but i want to be able to have a page within Components.Shared for my login page that can be used by multiple projects when this solution expands but when i create a login page within the Components.Shared it is unable to direct to the page and says:

Sorry, there's nothing at this address.

I assume this is the case because the RouteData inside my App.Razor which is situated within Projection.Shared therefore cant access the pages within Components.Shared, is there a possible way round this?

like image 860
bobby Avatar asked Jun 19 '26 04:06

bobby


1 Answers

I figured out the answer, in case anybody else runs into this in the future. Adding the below to the App.Razor file allows it to look at multiple projects:

AdditionalAssemblies = "new[] { typeof(Shared.Components.App).Assembly }"
like image 173
bobby Avatar answered Jun 21 '26 19:06

bobby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!