Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 docker debugging - "no symbols have been loaded"

I'm trying to debug two C# .NET 6.0 Docker containers from Visual Studio 2022, but the breakpoints I set always show "no symbols have been loaded".

The two Docker containers are in a docker-compose.yml file, at version 3.9 and Docker Desktop shows them running okay.

In VS2022, I've tried Debug > Attach to Process with:

  • Connection Type of "Docker (Linux Container)"
  • Debug these Code types set to "Managed (.NET Core for Unix)".

I can list the contents of the containers and see the .pdb files.

I've tried deleting the containers and images in Docker Desktop, cleaning the VS solution and re-building and re-starting the containers, but get the same error.

like image 954
Artie Leech Avatar asked Oct 25 '25 16:10

Artie Leech


1 Answers

If you're trying to debug a referenced project make sure that DebugType option is set to portable to create cross-platform PDB file in the referenced project file. Learn more about DebugType in C# Compiler Options that control code generation.

<PropertyGroup>
  <DebugType>Portable</DebugType>
</PropertyGroup>
like image 59
Volodymyr Lytvynchyk Avatar answered Oct 28 '25 06:10

Volodymyr Lytvynchyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!