Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2017 and Docker: Operation aborted

.Net Core 2 came out, so I updated Visual Studio 2017 (Community) to release 15.3.0 (and subsequently 15.3.2) which has support for Docker which I've installed on my machine (Windows 10), and I believe I've configured things correctly.

I created a basic Web API project—on .NET Core 2.0 without Docker—and that works. Now I add Docker support and I can't get it to run! I get the following error:

Microsoft Visual Studio: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

How do I debug this? The only other Q&A I found wasn't helpful. If you recognize the error, do you know how to fix it?

like image 629
ricksmt Avatar asked Aug 24 '17 16:08

ricksmt


People also ask

What is Docker debug mode?

If you are having trouble with Docker containers or images, you can turn on debug mode on your Docker daemon. Enabling debugging provides more verbose output from the daemon and you can use this information to find out more about why your containers or images are having issues.

How do I deploy a Docker container in Visual Studio?

Right-click on the project node and choose Publish.... A screen showing deployment options appears. Choose Docker Container Registry, and then choose Docker Hub. Enter your Docker credentials.

Can I run Visual Studio in a Docker container?

The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set.

How do I add Docker support to an existing project in Visual Studio?

Existing app Open the project in Visual Studio, and choose one of the following options: Select Docker Support from the Project menu. Right-click the project in Solution Explorer and select Add > Docker Support.


1 Answers

I was having the same issue. I found this forum post which suggests the fix is either:

  1. Reset the credentials on the shared drive settings for Docker
  2. Delete the [stale] microsoft/aspnetcore:2.0 image and pull the latest again from DockerHub

The first suggestion did not work for me, but the second did. I probably didn't need to do this, but I also nuked my existing containers and images for the project I was working on.

The Visual Studio build process with Docker support enabled will automatically pull microsoft/aspnetcore:2.0 if the image is not found locally. So, it's easiest to remove the cached image and let the build process pull it down for you.

In order to see local images, from the command line:

docker images

If you see microsoft/aspnetcore:2.0, then remove the image from your local cache:

docker rmi microsoft/aspnetcore:2.0

After that, when you next build... all is good again.

like image 138
Mike L Avatar answered Sep 30 '22 07:09

Mike L