Open dmbaker90 opened 2 years ago
Hi,
I get a similar problem when debugging as Asp.Net Core web application.
I was able to hit a break point set in Program.cs but after I continue running the application seems to crash.
It opens the browser with http://localhost:5000/ but unreachable.
The code is simply:
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => DateTime.Now.Ticks.ToString());
app.Run();
The launch config used was:
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net8.0/console.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
Any help will be appreciated - TIA!
Issue Description
Cannot debug webapi projects. For some reason I can debug Startup.cs, but then it crashes, I can't get to a point where I can debug a Controller endpoint.
dotnet run
works fine without debugging. I'm not sure if I'm doing something wrong.Steps to Reproduce
dotnet new webapi
code .
Launch.json:
tasks.json:
Expected Behavior
Debugger should launch. Debugger should stay running and hit breakpoints in Controller.
Actual Behavior
Debugger launches, hit's breakpoints in Startup.cs, then stops working. Code stops running. Browser auto opens http://localhost:5000/ but the server already stopped running.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.61.0 C# Extension: 1.23.16
Mono Information
OmniSharp using built-in monoDotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.205 Commit: 64a0cf25eb Runtime Environment: OS Name: manjaro OS Version: OS Platform: Linux RID: arch-x64 Base Path: /usr/share/dotnet/sdk/5.0.205/ Host (useful for support): Version: 5.0.8 Commit: 42ac4d6d5a .NET SDKs installed: 5.0.205 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |csharp|muhammad-sammy|1.23.16|;