带有Visual Studio的Docker工具箱-未启用卷共享 [英] Docker toolbox with Visual studio - Volume sharing is not enabled

查看:748
本文介绍了带有Visual Studio的Docker工具箱-未启用卷共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Visual Studio 2017为在Linux容器上运行的.net core 2.0 Web应用程序提供docker支持。我正在使用装有Win 7操作系统的计算机,因此必须使用带有Virtual box的Docker工具箱。我已经检查了这个问题:



我什至可以使用命令行将其安装到该文件夹​​中,但仍然无法解决该问题。有任何想法吗?

解决方案

最后,我运行了该程序。 VS发出的错误消息极具误导性,与卷共享无关。最终,我意识到问题出在运行调试器上,因为当我使用ctrl + F5运行解决方案时,一切正常,并且容器正确启动。仅在使用F5运行并尝试附加调试器时才出现问题。



然后我在控制台输出中找到了一些线索。 VS尝试使用名为 GetVsDbg.ps1 的Powershell脚本下载一些工具来调试容器。运行此脚本时,我会观察到以下错误:


Add-Type:无法添加类型。程序集
'System.IO.Compression.FileSystem'找不到。


最后,我通过更新来解决此问题powershell版本与安装在计算机上的.net框架发生冲突。这里是链接:



https://www.microsoft.com/zh-cn/download/details.aspx?id=40855


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. Here is the link:

https://www.microsoft.com/en-us/download/details.aspx?id=40855

这篇关于带有Visual Studio的Docker工具箱-未启用卷共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆