Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove docker support from an ASP.NET Core project?

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.

like image 750
ggabor Avatar asked Jan 13 '17 19:01

ggabor


People also ask

How do I enable Docker support for an existing project?

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.

What is the use of Docker in ASP.NET Core?

The Docker platform uses the Docker engine to quickly build and package apps as Docker images. These images are written in the Dockerfile format to be deployed and run in a layered container. This tutorial is not for ASP.NET Core apps.

Can you Containerize .NET application?

Containerizing a . NET application is easy. You can do this by copying source code files and building a Docker image.


2 Answers

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.

like image 178
user5004137 Avatar answered Sep 24 '22 01:09

user5004137


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

like image 39
cuasijoe Avatar answered Sep 22 '22 01:09

cuasijoe