Skip to content

Visual Studio 2022 and Docker project debugging issues #396

Description

@rh101

Something broke as a result of either a Visual Studio update, a Docker Desktop update, or something I've added to my project, but I can't seem to be find a way to diagnose the issue.

Visual Studio 2022 v17.7.0 and Docker Desktop 4.22.0 using latest WSL2 on Windows 10 Pro (32GB RAM, Ryzen 5XXX series CPU).

I have a VS solution with over 40 projects (WebAPI services etc), and the docker compose file has 27 services defined, and these include MongoDb, PostgreSQL and RabbitMQ.

Starting up the project, everything builds fine, but then it gets to this point:

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------

...and then everything stops...

After waiting several minutes, and hitting the 'Stop Debugging' button, many popups appear (perhaps one per WebAPI service):
image

On occasion VS2022 would completely freeze if I attempt to stop it while it is in this state.

Sometimes it actually continues past this point:

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
[02:52:41 WRN] Overriding address(es) 'https://+:443, http://+:80'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.10/System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'Program.<Main>'
Step into: Stepping over non-user code 'Program.<Main>$'
Step into: Stepping over non-user code 'Program.<<Main>$>d__0..ctor'
Loaded '/usr/share/dotnet/shared/Microsoft.AspNetCore.App/7.0.10/Microsoft.Extensions.Options.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/share/dotnet/shared/Microsoft.AspNetCore.App/7.0.10/Microsoft.Extensions.Logging.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

... and once again, everything stops... no more console output, services can't be connected to etc.

Other times, it works, like nothing was wrong at all, and everything starts up correctly.

This issue is happening with the eShopOnContainers sample too, so it's not limited to my project.

Note that if I use docker compose up outside of Visual Studio, then all docker containers start up correctly and everything works as expected.

I can't quite figure out what is causing all of this. If someone has a solution, then great, and if not, then I would appreciate any guidance as to where I should start looking in order to track down the root cause of this problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions