Visual Studio容器工具要求Docker在构建,调试或运行容器化项目之前运行

编程入门 行业动态 更新时间:2024-10-20 18:56:33
本文介绍了Visual Studio容器工具要求Docker在构建,调试或运行容器化项目之前运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在研究.Net核心微服务.我安装了包含docker cli和kitematics的Docker Toolbox.之后,我在Visual Studio 2017中创建了一个简单的(.Net核心)Web api项目,还启用了Docker支持.

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.

但是当我按F5键运行该程序时,它显示以下错误并且无法运行.

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

Visual Studio容器工具要求Docker在构建,调试或运行容器化项目之前运行.

请查看附件中的图像.

运行项目时出现Visual Studio错误

Visual studio error on running the project

如果我使用docker cli构建并运行项目,则该项目正在运行.问题出在Visual Studio 2017中.

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

推荐答案

出现此问题是因为Visual Studio容器无法连接Windows的docker,为此的解决方案是使用以下命令从Docker CLI打开Visual Studio 2017. /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/Community/Common7/IDE/devenv.exe C:\\PATH\\TO\\MY\\SOLUTION.sln

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

这里:

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

是我的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.

更多推荐

Visual Studio容器工具要求Docker在构建,调试或运行容器化项目之前运行

本文发布于:2023-11-15 02:53:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1590508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:容器   工具   项目   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!