Debugging Blazor WASM in VS Code leaves process behind when finished
See original GitHub issueDescribe the bug
When debugging Blazor WASM 3.2 preview 3 in VS Code and Chrome there is a process left behind after you stop debugging that prevents a subsequent debugging run as it still has ports 5000 and 5001 reserved.
To Reproduce
Create a new Blazor WASM project. Debug it following the instructions on the blog here:
https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available
Stop debugging.
Attempt to start a new debugging session.
Error in debug window:
crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.IO.IOException: Failed to bind to address https://127.0.0.1:5001: address already in use.
---> Microsoft.AspNetCore.Connections.AddressInUseException: Address already in use
---> System.Net.Sockets.SocketException (48): Address already in use
A ps -ax | grep blazor reveals:
59023 ?? 0:05.00 dotnet /Users/adam/.nuget/packages/microsoft.aspnetcore.components.webassembly.devserver/3.2.0-preview3.20168.3/build/../tools/blazor-devserver.dll serve --applicationpath /Users/adam/Repos/blazordebug/bin/Debug/netstandard2.1/blazordebug.dll
Killing this process allows you to start a new debugging session as normal.
Further technical details
.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.13-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.201/
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
3.1.200 [/usr/local/share/dotnet/sdk]
3.1.201 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17 (12 by maintainers)
I have the same problem.
This is going to be handled as part of https://github.com/dotnet/aspnetcore/issues/19246