"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
- Open an ASP.NET Core 8.0 MVC project in VS Code
- Right-click the project folder
- Select "Debug > Start New Instance"
- 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) |
"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
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
Broken Versions
Actual Behavior
Steps To Reproduce
Steps to Reproduce
https://localhost:5001orhttp://localhost:5000)Expected Behavior
Expected Behavior
Actual Behavior
Environment Information