Skip to content

Instantly share code, notes, and snippets.

@weehong
Last active March 8, 2025 09:49
Show Gist options
  • Save weehong/696e773ac38d20788e46b10ab82e62d2 to your computer and use it in GitHub Desktop.
Save weehong/696e773ac38d20788e46b10ab82e62d2 to your computer and use it in GitHub Desktop.
Visual Studio Code - Run and Debug Setup for .NET Core Project
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch .NET 9.0 Web API",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/<project_name>/bin/Debug/net9.0/<project_name>.dll",
"args": [],
"cwd": "${workspaceFolder}/src",
"stopAtEntry": false,
"console": "internalConsole",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"externalConsole": false
}
]
}

This Gist shows the Run and Debug configuration on Visual Studio Code for the .NET Core project.

Folder Structure

/root/workspace/dotnet/<solution_project_name>/
│
├── .vscode/
│   ├── launch.json
│   └── tasks.json
│
├── src/
│   └── <project_name>/
│       ├── bin/
│       │   └── Debug/
│       │       └── net9.0/
│       │           └── <project_name>.dll
│       ├── <project_name>.csproj
│       └── (other project files)
│
└── <solution_project_name>.sln
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/<project_name>/<project_name>.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment