如何从网络共享调试 Visual Studio 2010 中的解决方案? [英] How can I debug solutions in Visual Studio 2010 from a network share?

查看:16
本文介绍了如何从网络共享调试 Visual Studio 2010 中的解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近有了一台新的 Mac 笔记本电脑,并且正在 Parallels 虚拟机中运行 VS2010.它对我来说大多运行良好,但我在调试特定项目类型时遇到了一些问题,这与项目是通过网络共享访问的事实有关.测试项目无法运行,因为测试运行器无法加载测试的 DLL.Web 项目在 Visual Studio mini Web 服务器中运行失败,抛出以下异常:

I've recently got a new Mac laptop and am running VS2010 in a Parallels virtual machine. It's mostly working out well for me, but I'm having some problems with debugging specific project types, related to the fact that the projects are being accessed via a network share. Test projects don't run because the test runner can't load the tests' DLL. Web projects fail to run in the Visual Studio mini web server, throwing the following exception:

'加载配置文件时出错:无法开始监视对 path\to\web.config 的更改.

我花了一个晚上在网上搜索,但运气不佳.阅读这些两篇 帖子,我尝试了通常的 CasPol 更改,但后来发现 这篇文章来自早期 VS2010 测试版之一,表明 CasPol 是.NET 4.0 和 VS2010 不再需要/支持.

I've spent the evening trawling the web with little luck on this. After reading these two posts, I tried out the usual CasPol changes, but then found this post from one of the early VS2010 betas indicating that CasPol is no longer needed/supported in .NET 4.0 and VS2010.

网络共享可通过映射驱动器和 UNC 路径访问.UNC路径的宿主是.pfs;根据这篇文章 Windows 对待主机名以源自 Internet 区域的点开头.

The network share is accessible via both a mapped drive and the UNC path. The host for the UNC path is .pfs; according to this post Windows treats host names starting with a dot as originating in the Internet Zone.

虚拟机在管理员帐户下运行其应用程序,该帐户似乎拥有创建、读取、写入和删除文件和文件夹所需的所有网络共享权限.我说似乎有",因为我无法通过资源管理器查看相应文件夹的安全属性:安全选项卡不存在.

The virtual machine runs its applications under the administrator account, which appears to have all the necessary permissions on the network share to create, read, write and delete files and folders. I say "appears to have" as I can't view the Security Properties of the appropriate folder via Explorer: the Security tab just isn't present.

有没有人成功地从 VS2010 中的网络共享加载和调试 Web 和测试项目?

Has anyone managed to successfully load and debug web and test projects from a network share in VS2010?

更新:我尝试使用我的 MacBook 的 IP 地址在单独的本机 Windows 机器上加载 VS2010 中的解决方案,结果喜忧参半.测试项目再次运行失败,报错:

UPDATE: I tried loading the solutions in VS2010 on a separate native Windows machine using the IP address of my MacBook, with mixed results. The test project again failed to run with the error:

Error loading \\192.168.0.4\alastair\Code\project\bin\Debug\Tests.dll: 无法加载文件或程序集 'file://\\192.168.0.4\alastair\Code\project\bin\Debug\Tests.dll' 或其依赖项之一.不支持操作.(来自 HRESULT 的异常:0x80131515)

但是,ASP.NET MVC 项目在此设置中按预期正确运行,如果我使用 MacBook 的 NETBIOS 名称,我在这里得到完全相同的结果.

However, the ASP.NET MVC project runs correctly as expected in this setting, and I get exactly the same results here if I use the NETBIOS name of the MacBook.

当然,为了做到这一点,我必须在 Snow Leopard 中启用 SMB 共享,这不是访问 Parallels VM 中的位置所必需的.也许我需要调整 Parallels 中的某些设置来更改共享权限?

Of course, in order to do this, I had to enable SMB sharing in Snow Leopard, which wasn't required to access the location in my Parallels VM. Maybe there's some setting in Parallels that I need to tweak to change permissions on the share?

我也标记了这个问题,让版主请求将其移至 StackOverflow;我认为它可能是一个比 SuperUser 更合适的论坛.

I've also flagged this question for the moderators to request it be moved to StackOverflow; I think it might be a more appropriate forum than SuperUser.

推荐答案

尝试在 devenv.exe.config 的运行时元素下设置 <loadFromRemoteSources enabled="true"/>,按照建议在这个问题的答案中.它为我解决了这个问题......从共享加载项目时,Visual Studio 仍然会警告我,但运行测试现在可以工作了.

Try setting <loadFromRemoteSources enabled="true"/> under the runtime element of devenv.exe.config, as suggested in the answer to this question. It fixed the issue for me... Visual Studio still warns me when loading a project from the share, but running tests now works.

这篇关于如何从网络共享调试 Visual Studio 2010 中的解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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