Description
Describe the bug
Starting a debug session for Blazor WASM from within VSCode works fine the first time. Closing the debug session and trying to start another one causes the below error to pop up.
"It looks like a browser is already running from an old debug session. Please close it before trying to debug, otherwise VS Code may not be able to connect to it.
(Cancel / Debug Anyway)"
Trying to start from command line using "dotnet run" after this fails as the port is still in use. The only way to resolve the issue is to reboot or go hunting for the orphaned process and force kill it.
I have always had this problem with Blazor WASM apps for dotnet-sdk-5.0 and now have the same problem with a brand new app created using dotnet-sdk-6.0.
To Reproduce
- Install VSCode, dotnet-sdk-6.0 and Chromium on Linux Debian 10.
- Create a new blazorwasm app: "dotnet new blazorwasm --auth Individual -o dotnet6blazorwasm -ho"
- Open in VSCode
- Debug the Server project
- Stop debugging
- Start debugging again
Further technical details
- ASP.NET Core version: 6.0
- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: VSCode 1.62.2
- Include the output of
dotnet --info
:
dotnet --info Output
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: debian
OS Version: 10
OS Platform: Linux
RID: debian.10-x64
Base Path: /usr/share/dotnet/sdk/6.0.100/
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
3.1.415 [/usr/share/dotnet/sdk]
5.0.403 [/usr/share/dotnet/sdk]
6.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.21 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.21 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Activity