aspnetcore: [Blazor] Preview 6 blazorhosted project publish is broken
Describe the bug
Using preview 6 sdk/templates, when publishing a blazor hosted project, publish output seems broken and trying to run the published app does not work
To Reproduce
Steps to reproduce the behavior:
dotnet new blazorhosted -o HostedTestcd HostedTest\HostedTest.Serverdotnet publish -c Release -o bin\release\publishcd bin\release\publishdotnet HostedTest.Server.dll- Navigate to
http://localhost:5000=> 404
Additional context
It seems that the publish output folder is not right. For example the index.html file is missing from the HostedTest.Client\dist folder.
Here is the kestrel log of the request
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'Fallback {*path:nonfile}'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'Fallback {*path:nonfile}'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 27.119500000000002ms 404
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 15 (8 by maintainers)
I believe this is actually fixed as per my changes in https://github.com/aspnet/AspNetCore/commit/0a4f42a7e2030697ecf2c35b5de8b524b8bbf42f.
@mkArtakMSFT i will try this workaround when i have the time. Please note that moving this issue to to 3.1 milestone means that client blazor apps will never be able to be hosted in IIS which a lot of us use. I argue guys to reconsider.
I could not agree more. It seems like it would be a huge miss to move this to 3.1, it’s not like this is a feature request to get publishing into IIS, this is a regression bug. Preview 5 worked just fine with IIS publishing.
@DustinCampbell you must add this part too if you are using static files found inside your blazor project folder