After creating an ASP.NET Core app from web template in Visual Studio and clicking Add Docker Support, it runs fine in debug mode initiated by Visual Studio.
However if debugging is stopped in Visual Studio then the container no longer responds even though it is still running and can be entered via terminal etc. The ports are still listening but it just doesn't work anymore.
Start debugging




Stop debugging

All other info above remains the same with no indication the container is even aware Visual Studio has stopped. The container is still accessible:

The mapped ports are still listening so there is a process backing the socket:

But the site no longer works:

What is Visual Studio doing to make this container respond? Where is the documentation for it?
Apparently Visual Studio does some tricks when building for debugging so the image doesn't work without VS. If you build the image yourself with docker build, it'll work in Docker Desktop.
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