To use dotnet watch
with debugging in Visual Studio Code, follow these steps:
{ "name": ".NET Core Watch", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/<project-name>.dll", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, "console": "internalConsole", "env": { "ASPNETCORE_ENVIRONMENT": "Development" }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" }, "pipeTransport": { "pipeCwd": "${workspaceFolder}", "pipeProgram": "dotnet", "pipeArgs": [ "watch", "run" ], "debuggerPath": "/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.7/libdbgshim.so" } }
<project-name>
with the name of your project.dotnet watch run
.This configuration will launch your application with dotnet watch
and attach the debugger to it. You can set breakpoints and step through your code as usual.
"dotnet watch debug Visual Studio Code"
"configurations": [ { "name": ".NET Core Launch (web)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/YourApp.dll", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, "serverReadyAction": { "action": "openExternally", "pattern": "\\bNow listening on:\\s+(https?://\\S+)" }, "internalConsoleOptions": "openOnSessionStart", "launchBrowser": { "enabled": true, "args": "${auto-detect-url}", "windows": { "command": "cmd.exe", "args": "/C start ${auto-detect-url}" }, "osx": { "command": "open" }, "linux": { "command": "xdg-open" } }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" } } ]
dotnet watch
. Adjust the paths and settings based on your project structure."dotnet watch Visual Studio Code launch.json tasks"
"tasks": [ { "label": "build", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/YourApp.csproj" ], "problemMatcher": "$msCompile" } ]
dotnet watch
."dotnet watch debug attach to process Visual Studio Code"
"configurations": [ { "name": ".NET Core Attach", "type": "coreclr", "request": "attach", "processId": "${command:pickProcess}" } ]
dotnet watch
process."dotnet watch debug external console Visual Studio Code"
"internalConsoleOptions": "neverOpen"
dotnet watch
.jq sqldatatypes firebaseui interruption timeout android-drawable .htaccess inotifypropertychanged angular2-pipe semantic-ui