Skip to content

Debug Launch Failures for ASP.NET Core MVC Projects since new Workspace-based development hybrid experience #3181

@sherrsw

Description

@sherrsw

"Right-Click > Debug > Start New Instance" fails intermittently with port binding errors on ASP.NET Core 8.0 MVC projects

Severity

High (blocks debugging workflow)


Affected Project Details

  • Framework: ASP.NET Core 8.0
  • Launch Configuration:
    • IIS Express (port 44308)
    • Kestrel (ports 5000/5001)
  • Project Complexity:
    • Large monorepo with 100+ dependency injections
    • 7 SQL Server database contexts
    • Azure AD authentication integration

Description

After updating to the latest C# and C# Dev Kit extensions, the debugging experience for ASP.NET Core projects is severely degraded. Attempting to start a new debug instance (Right-Click Project > Debug > Start New Instance) fails with "localhost refused to connect" errors.

Regression Information

Works 100% of the time when reverting to the prior version of C# and C# Dev Kit.

Working Versions

  • C# Extension: v2.130.5
  • C# Dev Kit: v3.10.14

Broken Versions

  • C# Extension: v2.140.8+
  • C# Dev Kit: v3.10.15+

Actual Behavior

  • ❌ Browser displays: "ERR_CONNECTION_REFUSED" or "This site can't be reached - localhost refused to connect"
  • ❌ Dev tools indicate no service is listening on the configured ports
  • ❌ The dotnet process fails to bind to ports 5000/5001
  • ❌ Stopping the debugger sometimes leaves zombie dotnet processes
  • Frequency: 95% of the time; only randomly does it work

Steps To Reproduce

Steps to Reproduce

  1. Open an ASP.NET Core 8.0 MVC project in VS Code
  2. Right-click the project folder
  3. Select "Debug > Start New Instance"
  4. Attempt to navigate to the configured URL (e.g., https://localhost:5001 or http://localhost:5000)

Expected Behavior

Expected Behavior

  • ✅ App compiles and starts listening on the configured ports
  • ✅ Browser connects successfully to the application
  • ✅ Stopping the debugger cleanly terminates the process

Actual Behavior

  • ❌ Browser displays: "ERR_CONNECTION_REFUSED" or "This site can't be reached - localhost refused to connect"
  • ❌ Dev tools indicate no service is listening on the configured ports
  • ❌ The dotnet process fails to bind to ports 5000/5001
  • ❌ Stopping the debugger sometimes leaves zombie dotnet processes
  • Frequency: 95% of the time; only randomly does it work

Environment Information

Component Version/Details
VS Code Latest
C# Extension v2.140.8+ (issue occurs; works on v2.130.5)
C# Dev Kit v3.20.199+ (issue occurs; works on v3.10.14)
.NET SDK .NET 8.0
OS Windows
Project Type ASP.NET Core Web Application (MVC)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions