Visual Studio Container Tools requires Docker to b

2019-02-17 11:51发布

I am working on .Net core Microservices. I installed Docker Toolbox containing docker cli and kitematics. After that i created a simple (.Net core) web api project in visual studio 2017 and also enable docker support.

But when i hit F5 to run the program it shows following error and doesn't run.

Visual Studio Container Tools requires Docker to be running before building, debugging or running a containerized project.

Please review the attached image.

Visual studio error on running the project enter image description here

If i build and run the project using docker cli, it's working. The problem is with visual studio 2017.

2条回答
Rolldiameter
2楼-- · 2019-02-17 12:32

I was facing the same issue and I resolved it by switching to IIS Express instead of Docker in debug menue on visual studio 2017

enter image description here

查看更多
虎瘦雄心在
3楼-- · 2019-02-17 12:50

The problem occurs because Visual studio container is unable to connect to docker for windows and solution for this is to open the visual studio 2017 from Docker CLI using following command. /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/Community/Common7/IDE/devenv.exe C:\\PATH\\TO\\MY\\SOLUTION.sln

Here:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe

is the location of my devenv.exe file and 2nd parameter

C:\\PATH\\TO\\MY\\SOLUTION.sln

shows the path of solution file.

For further details of this solution, click Here.

查看更多
登录 后发表回答