带有 Visual Studio 的 Docker 工具箱 - 未启用卷共享 [英] Docker toolbox with Visual studio - Volume sharing is not enabled
问题描述
我正在尝试使用 Visual Studio 2017 为在 Linux 容器上运行的 .net core 2.0 Web 应用程序运行 docker 支持.我正在使用 win 7 操作系统的机器上工作,所以我必须使用带有 Virtual box 的 Docker 工具箱.我已经检查过这个问题:
我什至可以用命令行 cd 进入这个文件夹,但仍然无法解决这个问题.对此有什么想法吗?
我终于开始运行了.来自 VS 的错误消息非常具有误导性,它与卷共享无关.最终我意识到问题出在运行调试器上,因为当我使用 Ctrl + F5 运行解决方案时,一切正常,容器正确启动.仅在使用 F5 运行并尝试附加调试器时才会出现问题.
然后我在控制台输出中找到了一些线索.VS 尝试下载一些工具,用于使用名为 GetVsDbg.ps1
的 powershell 脚本调试容器.运行此脚本时,我可以观察到如下错误:
添加类型:无法添加类型.大会找不到System.IO.Compression.FileSystem".
最后我通过更新 powershell 版本解决了这个问题,该版本与我机器上安装的 .net 框架有冲突.
I'm trying to get running a docker support with Visual studio 2017 for a .net core 2.0 web app running on linux containers. I'm working on machine with win 7 OS, so I must use a Docker toolbox with Virtual box. I've already checked this question: How to get docker toolbox to work with .net core 2.0 project, but I got stuck in the following problem, when trying to run it with VS:
Volume sharing is not enabled. Enable volume sharing in the docker ce for windows settings
So far I know that there is a default volume mounted under the C:Users, so my project files should be copied somewhere under this folder in case I don't want to mount any other volume. So I copied them there.
When I check the settings of my Virtual box, folder seems to be shared:
I can even cd into this folder with command line, but still can't get over this problem. Any ideas about this?
Finally I got this running. Error message comming from VS is very misleading and it has nothing to do with volume sharing. Eventually I realized that problem is in running a debugger, because when I ran solution with Ctrl + F5 everything was ok and container started correctly. Problem occurred only when running with F5 and trying to attach a debugger.
Then I found some clues in console output. VS tries to download some tooling for debugging containers with powershell script named GetVsDbg.ps1
. When running this script I could observe errors like:
Add-Type : Cannot add type. The assembly 'System.IO.Compression.FileSystem' could not be found.
Finally I fixed this issue by updating powershell version which was somehow in collision with my .net framework installed on my machine.
这篇关于带有 Visual Studio 的 Docker 工具箱 - 未启用卷共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!