Visual Studio 测试不会通过网络共享运行 [英] Visual Studio Test won't run over a network share

查看:48
本文介绍了Visual Studio 测试不会通过网络共享运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行在 Visual Studio 2008 下运行良好的测试套件时,在输出窗口中出现以下错误:

When I try to run my test suite, which works fine under Visual Studio 2008, I get the following error in the Output window:

加载 J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll 时出错:无法加载文件或程序集 'file:///J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll' 或其依赖项之一.不支持操作.(来自 HRESULT 的异常:0x80131515)

Error loading J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll: Could not load file or assembly 'file:///J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

请注意,这些相同的测试可以在测试视图"窗口中查看,并且在 Visual Studio 2008 下运行良好,但只能在 VS2010 下失败.

Note that these same tests can be viewed in the Test View windows, and run well under Visual Studio 2008, but fail only under VS2010.

注意PFTest.dll是测试项目的名字,dll是我编译时创建的文件(编译没问题).

Note that PFTest.dll is the test project's name, and the dll is the file created when I compile (which compiles ok).

推荐答案

strong text 除了上述之外,我意识到我也无法单步执行代码,因为无法从共享驱动器加载已编译的 dll 和 exe.

strong textIn addition to the above, I realised I could not step through code either since the compiled dlls and exe could not be loaded from the shared drive.

这解决了问题.编辑 C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

This solved the problem. Edit C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

下添加 使其看起来像这样:

Add <loadFromRemoteSources enabled="true"/> under <runtime> so that it looks like this:

<runtime>
    <loadFromRemoteSources enabled="true" />
    <UseSmallInternalThreadStacks enabled="true" />
    ...

这篇关于Visual Studio 测试不会通过网络共享运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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