Blazor (client side) hosted in IIS not working under AspNetCore 3 Preview 6 #11425
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
If you believe you have an issue that affects the security of the platform please do NOT create an issue and instead email your issue details to secure@microsoft.com. Your report may be eligible for our bug bounty but ONLY if it is reported through email.
Describe the bug
Hosting Blazor apps in IIS doesn't seem to work under Preview 6. I always get the message "This localhost page can’t be found" (in Chrome). The app runs fine in Visual Studio 2019 Preview (16.2.0 Preview 2.0). But when I publish the code to an IIS website I get the error. I'm thinking it has something to do with the new MapFallbackToClientSideBlazor call in Startup.Configure (but that's just a guess).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected the site to run
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Here's what I get at the command line when I start the executable and navigate to port 5000:
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\joel.wilson\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at r
est.
Hosting environment: Production
Content root path: c:\junk\pre6\WebApplication1\WebApplication1.Server\bin\Debug\netcoreapp3.0\publish
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
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 41.8796ms 404
It doesn't seem to be routing to the fallback path correctly (which is set in Startup.cs with the following code:
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
endpoints.MapFallbackToClientSideBlazor<Client.Startup>("index.html");
});
)
But, again, it runs fine under IISExpress/Visual Studio 2019 Preview.
dotnetinfo6.txt
The text was updated successfully, but these errors were encountered: