简体   繁体   中英

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?

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 }"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM