JohnK-7484 avatar image
0 Votes"
JohnK-7484 asked JohnK-7484 commented

Dockerized ASP.NET apps no longer starting from Visual Studio

I have two containerized ASP.NET applications in a single VS2019 solution, that I usually run using docker-compose via Visual Studios integrated tools. I'm starting them either without debugger (using CTRL+F5), or with debugger (using just F5). This setup has worked for a couple of years now. But a few days ago, all of a sudden, the applications aren't starting up anymore when I try to start them from Visual Studio. The containers are being build, but the Container Tools output just says "========== Launching ==========" and then nothing. And the logs from both of the started containers are empty.

I'm not sure if this has anything to do with the fact that VS will add some overrides to the docker-compose file (like "ENTRYPOINT tail -f /dev/null") but then again, it has always worked until now, so I don't know why this would suddenly start working.

I can still start up the applications from a terminal using the docker-compose CLI. However Visual Studio can't seem to attach a debugger to it if I run the containers that way, so I really need to get Visual Studio working again.

I can only think of three factors that may cause this:

  1. A change in my own code

  2. A bug in the latest VS2019 update

  3. A change in the latest Docker Desktop (Windows) update

I've eliminated number 1 by checking out an old version of my source code, but that didn't help.
I've eliminated number 2 by installing an older version of VS2019 Professional, but that also didn't help.

Has anyone else had any issues with this lately?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JohnK-7484
Could you tell me your visual studio's version. Will you encounter the same problem if you create a new project?
According to your description:

I've eliminated number 2 by installing an older version of VS2019 Professional, but that also didn't help.

Will you encounter this issue in the old version of Visual Studio?

0 Votes 0 ·

Well, are you sure the problem is with Docker Tools and not with Visual Studio? How can you tell?

0 Votes 0 ·

I just found the problem. It turned out this portion was missing from the launchSettings.json:

 "Docker": {
   "commandName": "Docker",
   "launchBrowser": true,
   "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
   "publishAllPorts": true

Strangly enough, I just needed to add it back to ONE of the applications, and now both get started through docker-compose by VS.

So, error on my part, sorry but thanks anyway!

0 Votes 0 ·

0 Answers