.NET 8 - Blazor in Module - dotnet.js file not served. #15653
Unanswered
websitewill
asked this question in
Q&A
Replies: 2 comments 10 replies
-
Keep Blazor component in razorclasslib and add it as reference to you module |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am still trying to get everything to work with Blazor.
I now have a blazor component being hosted from within an existing OC module.
The blazor component is in a separate project. It all works with RenderMode Server (and ServerPrerendered).
What doesn't work is the WebAssembly mode(s).
I can see that the blazor.web.js file is being downloaded from
/_framework/blazor.web.js
However that tries to pull this dotnet.js file and my Orchard setup is not serving that.
This file exists in the Blazor project itself - I see it in the /bin/Debug/net.8.0 folder.
What I suspect is that the way I have my OC setup, that file is not visible. Any ideas on what to do to make that also be available from /_framework/dotnet.js where it is expected?
EDIT
After more research, it looks as though a "normal" razor app would have routing inside if itself that is capable of serving all of the files from the _framework folder. I notice in the build output of my Orchard Module that none of the output from the Blazor web assembly project is included except for the dll and pdbs (none of the wasm, gz or js files). These would all be needed for this content to get executed in the browser. Not sure what I need to do to make this stuff available in OrchardCore.
As a test, I added controller+index view directly into my Orchard Web project. The page loads, the blazor component renders (initially) but is still not interactive there. Seems like OC is doing something with the routing to I need to address to make that dotnet.js (and everything else that is supposed to be in _framework) available in OC.
As an additional test, I used the same Blazor project in a vanilla MVC site - it works just fine there.
TIA!
Beta Was this translation helpful? Give feedback.
All reactions