MSTest运行失败,因为源程序集不受信任 [英] MSTest run fails because source assembly is not trusted

查看:81
本文介绍了MSTest运行失败,因为源程序集不受信任的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将xUnit添加到我们的测试项目中(对于Asserts,我们仍然使用MSTest作为框架),并且测试运行立即拒绝执行任何测试.这是错误消息:

无法将测试运行"{....}"排队 试运行部署问题: 文件或目录的位置 '... xUnit.dll'不可信.

解决方案

我花了一些力气在Google中找到答案,所以我把它放在这里,以防其他人遇到相同的问题.可以在此博客文章中找到详细的说明.. >

基本上,该修复程序涉及在Windows资源管理器中右键单击dll文件(例如xunit.dll),转到属性",然后单击安全性"文本旁边选项卡底部的取消阻止". Vista/Windows 2008似乎会自动将来自其他计算机或Internet的程序集标记为不安全.

正如一些评论者所提到的,您可能还需要重新启动Visual Studio才能使它生效.

I just added xUnit to our test project (for the Asserts, we're still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This is the error message:

Failed to queue test run '{ .... }' Test run deployment issue: The location of the file or directory '...xUnit.dll' is not trusted.

解决方案

It took me a few tries to find the answer in Google, so I'm putting it here in case anyone else runs into the same problem. A detailed description can be found at this blog posting.

Basically, the fix invovles right-clicking on the dll file (xunit.dll for example) in Windows Explorer, going to Properties, and clicking "Unblock" at the bottom of the tab next to the 'Security' text. It seems that Vista / Windows 2008 will automatically mark assemblies that come from other machines or the internet as unsafe.

As a couple commenters have mentioned, you may also need to restart Visual Studio for this to take effect.

这篇关于MSTest运行失败,因为源程序集不受信任的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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