33

I've installed Visual Studio 2017 Community RC with .NET Core and Docker (Preview) so I could try the "Add docker support" on my project.

Unfortunatelly I couldn't get things work together (win8.1 + docker toolbox + hyperv engine + docker tools seems like not works together well) so I decided to remove docker support from my project.

There was no any menu item to remove docker support so I just deleted all docker related files from the solution.

Currently I get an error when I try to build/rebuild/clean/...:

Error MSB4018 The "CleanWorkspace" task failed unexpectedly. System.IO.FileNotFoundException: The file 'D:\dev\AspNetCore\docker-compose.yml' was not found.

Error MSB4018 The "PrepareForCompile" task failed unexpectedly. System.IO.FileNotFoundException: The file 'D:\dev\AspNetCore\docker-compose.yml' was not found.

I tried to delete bin, obj, .vs folders without luck.

6
  • This is probably inside one of your project files, try opening the csproj file and check for this task, then remove these XML element and save the file. Commented Jan 13, 2017 at 19:48
  • 1
    Assuming you are using a source control you could do git reset --hard (or a counterpart of thereof)? Commented Jan 13, 2017 at 20:25
  • 1
    No, I'm not using git/tfs. Just installed the new vs2017 rc and started play with it. The question is: if there was an "add docker support" - where is the corresponding "remove docker support" - or how to remove completely it manually? Commented Jan 13, 2017 at 22:14
  • 1
    can you post an image of your solution explorer? Commented Jan 13, 2017 at 22:14
  • 1
    FWIW, simply dropping the "docker-compose" project from my solution, did it for me. I didn't have to delete any files. Commented Sep 27, 2017 at 20:21

6 Answers 6

44

If you look in your project folder you should see a user settings file called <projectname>.csproj.user.

Within this file it may look like the following

<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ActiveDebugProfile>Docker</ActiveDebugProfile> </PropertyGroup> </Project> 

Just change

<ActiveDebugProfile>Docker</ActiveDebugProfile> 

to

<ActiveDebugProfile>Debug</ActiveDebugProfile> 

You may be able to just delete this file as it is user settings and there may be nothing else relevant in the file, please check.

Please backup before any changes.

Sign up to request clarification or add additional context in comments.

Comments

7

Goto launchSettings.json file Locataed in : <YourProjectName>/Properties/launchSettings.json

Remove This lines :

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

1 Comment

Also, you will want to delete the docker file on the project.
5

Go to your project dependencies and check if you have any container package added. If you do, remove the container package and rebuild.

1 Comment

I deleted docker project, deleted csproj.user file, found all docker reference across solution folder and removed them all. But, this step actually helped at the end. Wthout this help an error like visual studio container tools requires docker to be running error stops compilation
5
  1. Remove the reference in Dependencies > Packages Microsoft.VisualStudio.Azure.Containers.Tools.Targets

  2. Remove DockerFile

  3. Remove these lines in launchSettings.json

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

  4. Remove this code in .Csproj

DockerDefaultTargetOS

Comments

4

I ran into same situation and wanted to remove Docker support for my project Visual Studio 2017 and .NET Framework 4.6.1 project (not asp.Net Core) but i believe this will work for Asp .Net Core projects too :

  • In the project explorer, look for a project named "docker-compose"

  • Right click and select option "Unload project". As soon as this
    project is unloaded you will see the IIS/browser options for running your project

If you ever wanted to re-enable docker support, please select the project "docker-compose" and click "Reload Project" this will remove all IIS/browser options and set Docker

Comments

1

I have a similar answer because my ActiveDebugProfile was already set to debug but that didn't really remove docker support from my project.

Right click on the solution in VS and click "Edit MyProjectName.csproj" in your .csproj file comment out (or delete) the tag called DockerComposeProjectPath in the PropertyGroup with your target framework

 <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <!--<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>--> 

Next, next to the Debug button where is says "Docker", there is a dropdown list where you select your start up project. Change this from "Docker" To the name of your project.

Lastly you will remove the "docker-compose" and the "Dockerfile" from your project, build to confirm everything is okay and you should be good to go!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.