Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor webassembly in single project #22736

Closed
malballah opened this issue Jun 9, 2020 · 8 comments
Closed

Blazor webassembly in single project #22736

malballah opened this issue Jun 9, 2020 · 8 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved

Comments

@malballah
Copy link

I am wondering how I can have the the server side and client side projects in a single project.
I am trying to merge the generated server side and client side projects in a single project because I am using module architecture.
Is it possible to do that?.

@Stryxus
Copy link

Stryxus commented Jun 9, 2020

I seriously doubt it because of dependency injection and aspnetcore having to be restructured to host website roots and knowing which files to serve. I think even Visual Studio it self would need to be modified because it would have to be built differently.

Your issue isnt just tied to Blazor WebAssembly but to aspnetcore as a whole pretty much.

@malballah
Copy link
Author

@Stryxus Thanks for your response!
So, what if I want to have another class library project to hold the razor components of another asp.net core module that loaded at runtime?

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Jun 10, 2020
@javiercn
Copy link
Member

@malballah thanks for contacting us.

It is not possible to have a webassembly app within an asp.net core host within a single project. This is due to the many things @Stryxus has pointed out and some more.

So, what if I want to have another class library project to hold the razor components of another asp.net core module that loaded at runtime?

I'm not sure what you mean by this.

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jun 10, 2020
@malballah
Copy link
Author

@javiercn
Thank you!
I mean having the projects generated from visual studio plus adding another class library which holds some razor components and I will load them with Location expander feature of asp.net core

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Jun 10, 2020
@javiercn
Copy link
Member

Location expander feature of asp.net core

this only works for razor pages, not razor components

@javiercn javiercn removed the Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label Jun 10, 2020
@malballah
Copy link
Author

@javiercn
Then the only way to use Blazor with modular architecture is to have client blazor project with each module and one hosing asp.net core, is it possible to have multiple client blazor projects with one hosting app?

@javiercn
Copy link
Member

Then the only way to use Blazor with modular architecture is to have client blazor project with each module and one hosing asp.net core, is it possible to have multiple client blazor projects with one hosting app?

I'm not really sure how you are trying to achieve this. You can have multiple independent Blazor apps hosted on a single asp.net core application or you can have a single app with different parts in separate razor class libraries that you can reference from the main app and reuse them.

If you are looking at not loading them ahead of time, we have a feature for this in the roadmap. See here for details

@malballah
Copy link
Author

@javiercn
Thank you!
Unfortunatly referencing the modules or their razor class libraries from the main app is not modular.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Jun 10, 2020
@ghost ghost added the Status: Resolved label Jun 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved
Projects
None yet
Development

No branches or pull requests

4 participants