Debug NetCore - ravipal/vscode-docker GitHub Wiki
-
Install the .NET Core SDK which includes support for attaching to the .NET Core debugger.
-
Install the C# VS Code extension which includes support for attaching to the .NET Core debugger in VS Code.
-
Mac users only: add
/usr/local/share/dotnet/sdk/NuGetFallbackFolder
as a shared folder in your Docker preferences.
- If needed, create a .NET Core project with
dotnet new
. - Open the project folder in VSCode.
- Wait until a popup shows, asking if you want to add required assets for debugging. Click "Yes":
- Open the command palette (F1 by default) and enter
Docker: Add Docker Files to Workspace...
. If you have already dockerized your app, you can instead doDocker: Initialize for Docker debugging
. Follow the prompts. - Switch to the debugging tab.
- Select the "Docker .NET Core Launch" launch profile.
- Optionally, set a breakpoint.
- Start debugging! (F5 by default)
For additional customization options, see the documentation on Tasks and Debugging.