Debugging Blazor Apps with WebAssemblyServer 5.0.x Kills IIS Express
See original GitHub issueDescribe the bug
On a Blazor WASM project, upgrading the Server to .NET 5 AND upgrading the Microsoft.AspNetCore.Components.WebAssemblyServer package to 5.0.x (I just tried the latest, 5.0.3) breaks any client-side debugging. After setting a breakpoint on a client page, the breakpoint does get recognized and turns fully red. However, the moment that breakpoint is hit, the .NET debugger detaches without warning or messages and IISExpress expectantly closes.
Also, attempting to debug using the remote debugger fails as well.
BREAKPOINT WITH Microsoft.AspNetCore.Components.WebAssemblyServer = 3.2.1 (Click GIF for full-screen resolution)

BREAKPOINT WITH Microsoft.AspNetCore.Components.WebAssemblyServer = 5.0.3 (Click GIF for full-screen resolution)

To Reproduce
You can easily repro with a clean, new project:
- Create a new
Blazor Appproject - Select
Blazor WebAssembly Appa. EnsureConfigure for HTTPSis selected (because I haven’t tested it off) b. EnsureASP.NET Core hostedis selected (because I haven’t tested it off) c.Progressive Web Applicationhas been tested both on and off with no change - Once the project is created, navigate to the Client project in Solution Explorer, and go to
Pages/[anypage]. Set a breakpoint in the code on any page that has code (I personally used theCounterpage as it’s very simple) - You may run the project now and ensure the breakpoint hits, or just skip to the next step
- Right click on
TestBlazorApp.Serverand clickProperties(or you can do the next 2 steps using the .csproj) - Under
Target Framework, select.NET 5.0 - Right click again on TestBlazorApp.Server
and clickManage NuGet Packages…` - There should only be 1 package, the
Microsoft.AspNetCore.Components.WebAssemblyServerwhich is onv3.2.1. Choose to upgrade this to5.0.3(the current latest) - Now clean and rebuild the project for good measure, though I found this not necessary to produce the bug
- Finally, run the app and hit the breakpoint again. Observe how IIS Express suddenly closes, and Visual Studio is no longer debugging the app.
If you can’t seem to repro or for other reasons would like me to create a sample github repo I can!
Exceptions (if any)
I couldn’t find any exceptions. IIS Exited with code -1, there is nothing in the EventViewer.
Further technical details
I am using the latest stable version of Visual Studio (16.8.5) along with the latest stable version of .NET that comes with Visual Studio. I believe that IIS is on 10.0. I am using a Windows 10 Pro Edition x64 with 64GB RAM and over 500GB of SSD space remaining. I have also tested on a separate device, a Surface Pro 7 with the VS Preview installed with the same result.
Using Chromium Edge: Dev (build 90.0.796.0) as well as the latest version of Chrome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)

Top Related StackOverflow Question
@nolanblew I think we tracked down the root issue in this case. There’s some JS-code that enables the debugger that was changed between 3.2 and 5.0. The problem you ran into was likely a result of the incompatibility between the two.
@BrennanConroy Alright, I’ve closed VS, deleted the
.vs, deleted all thebinandobjfolders, deleted all my nuget caches, restarted my computer, and tried again with no avail. The issue still persists.(Loading the dll on startup in the output now reveals:
Is that where you were looking when you determined it was still loading the old dll?
Also I am unable to create a new .net5 project as I don’t have that template in the non-preview build of VS2019. That won’t do anyways since the end goal is to upgrade an existing project