Search code examples
blazorblazor-client-side

Blazor WebAssembly site gives 404 after updating to 3.2.0 Preview 2


I've been working on a Blazor WebAssembly site built from the 3.2.0-preview1 template. I want to update versions, so I am first going to update it to preview2 per these instructions. I do so and all seems well: my site compiles, and I can run it and hit all server-side breakpoints without errors. Thus, my ASP.NET host is spun up and listening on https://localhost:5001. But when I try to view the site locally, I get an immediate 404, as if routing never kicked in or as if it cannot find my component with @page "/" on it.

Any idea how I can troubleshoot this? I am at a loss because I get no error message anywhere. I have nothing I can tweak on the server side, as it all seems to be working, and I have nothing I can tweak on the client side, because it isn't loading a client at all.

I have also tried updating all the way to preview3, but unsurprisingly, the very same symptom results.

I am using dotnet.exe version 3.1.300-preview-015048.

Here's my dotnet run output and the browser with network tab: enter image description here


Solution

  • Be sure that you aren't depending on .NET 5 prerelease packages when you meant to depend on v. 3.2 prerelease packages. This will be better after Blazor WebAssembly is in full release.