Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core: "The project doesn't know how to run the profile Docker." on Visual Studio 2017

Tags:

I have set up an ASP.Net Core Web application - this application runs Angular using .Net Core 2.2 -> 2.2.0-preview3. After initializing that project I thought I would have added working docker-support when clicking on "Add" -> "Docker Support" for "Linux Container" - but running this would prompt me with the following error-message:

enter image description here

Since I do have the option to add docker support there should be a way to run Angular in docker, right?

Docker Version: 18.09.0 
like image 637
TheRealVira Avatar asked Nov 28 '18 13:11

TheRealVira


People also ask

Can ASP.NET application be run in Docker container?

Choose the docker option to run the application as shown in the following image. After clicking on the docker option, it will build code, create a docker image as well as a docker container and run the application inside the docker container without using the docker commands on the windows command prompt.

How do I run a Docker container in Visual Studio?

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 know its late already, but it worked for me and i hope it helps.

1 - delete dockerfile present in the project

2 - then right click on the project > add > Docker support

3 - choose between widows or linux

This will recreate the dockerfile and add Microsoft.VisualStudio.Azure.Containers.Tools.Targets to your nugget dependencies. Updates will maybe be required.

4 - Run and should be just fine

like image 145
Júlio Almeida Avatar answered Oct 04 '22 04:10

Júlio Almeida