Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio 2022 from debugging in Docker

Since the Visual Studio 2022 17.5 update my builds have been taking ages - instead of ~10 seconds, I'm now waiting ~10 20 minutes or more.

If I look in the 'Container Tools' window I can see a docker build command being executed, and in the 'Background tasks' I see the message...

Warming up Docker debugging for project [my startup project]

I think this feature (added in the 17.5 update) seems to be triggered by the presence of a DOCKERFILE in the project.

While it's true that this main project (and others in the solution) does contain a DOCKERFILE, my team don't run these locally; we only build the containers in our devops pipeline after local development.

Furthermore, the base image we use is windowsservercore-ltsc2022, which is not what I run locally, so it's incompatible with my local system anyway.

Can I turn off this feature?


UPDATE
Some additional points:

  • This long build time only occurs after restarting Visual Studio.
  • I have Docker Desktop installed but not running. (I've repeated the steps with Docker Desktop already running, and it makes no difference.)
  • If I rename DOCKERFILE to, say, _DOCKERFILE then the problem goes away.
  • The solution in question is .NET Framework.

UPDATE 2
Even after renaming DOCKERFILE to _DOCKERFILE, the first build after restarting Visual Studioo still attempts to debug in a container - I see this in the Container Tools window...

66>------- Started building project: [name of my .NET Framework project]
66>Container warmup in progress – waiting for this to complete. See the Container Tools output pane for details.

I had to cancel the build after 45 minutes because it still hadn't completed. There must be a way to disable this feature?

like image 519
awj Avatar asked Jul 08 '26 16:07

awj


1 Answers

Removing the bin and obj folders and retrying worked for me

like image 51
Marvin Thobejane Avatar answered Jul 10 '26 07:07

Marvin Thobejane



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!