Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant add Docker Support Visual Studio 2017

I'm using VS 2017. I have a web service and I want to add docker support to it. When I right click and open up the menu to add docker support it is greyed out. What causes it to be greyed out? How can I add docker support to my app?

*Side note I went up to the solution and added a new project (web app) and when it's done adding that new project I'm able to add docker support to it but still not able to add support to my other web service. Also both projects are targeting .net Framework 4.5.2

like image 454
Pat Avatar asked May 02 '17 18:05

Pat


People also ask

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.

How do I get Docker support?

Right-click on your project and select Add | Docker Support. You'll get a dialog asking you to pick what operating system your container should use -- pick the same one you chose when installing Docker for Windows.

How do I add a container in Visual Studio?

To add container orchestration support, right-click on the project node in Solution Explorer, and choose Add > Container Orchestration Support. Then choose Docker Compose to manage the containers. If docker-compose. yml already exists, Visual Studio just adds the required lines of configuration code to it.


2 Answers

Try double-checking your .csproj, .sln, and solution and project folders for any references to Docker. There have been a few times where I have run into this, usually caused by adding, removing, and trying to re-add Docker support. Clearing out the Dockerfile in the project folder along any other Docker stuff in the solution solved the issue in my case.

like image 37
lardeatinghorse Avatar answered Sep 21 '22 09:09

lardeatinghorse


Edit the .csproj file and search for "docker" - remove the following line:

<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>

Also delete the file "Dockerfile" which should be in the same folder as the .csproj file.

like image 50
Tully Avatar answered Sep 21 '22 09:09

Tully