question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging Blazor WASM in VS Code leaves process behind when finished

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
sergiolindolfoferreiracommented, Mar 31, 2020

I have the same problem.

0reactions
mkArtakMSFTcommented, Apr 28, 2020

This is going to be handled as part of https://github.com/dotnet/aspnetcore/issues/19246

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug ASP.NET Core Blazor WebAssembly
Learn how to debug Blazor WebAssembly with browser developer tools and an integrated development environment (IDE).
Read more >
Cannot debug Blazor wasm
I'm using vscode. I cannot debug "standalone" (or "hosted") blazor wasm. There are many questions like this, but they are for RCs, ...
Read more >
Blazor Development / Workflow - Difficult, Complex, Buggy, ...
I'm using rider for blazor (wasm). The coding experience is very nice. Debugging and hot reload, not so much. I think they are...
Read more >
Debugging in VS Code, Chrome and Visual Studio : EP05
Blazor WebAssembly : Debugging in VS Code, Chrome and Visual Studio : EP05. 18K views · 3 years ago #Chrome # Debug #WebAssembly...
Read more >
C# programming with Visual Studio Code
Blazor WebAssembly App; Console App. And more. To find a full list of supported project types within VS Code, open the Command Palette...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found