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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With