为什么我的所有 Visual Studio 测试结果“未执行"? [英] Why are all my Visual Studio test results "Not executed"

查看:25
本文介绍了为什么我的所有 Visual Studio 测试结果“未执行"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的项目中运行我的单元测试时,我看到每个测试结果未执行".我已经重新启动了我的计算机,所以我怀疑这是某种挂起的进程问题.

When I run my unit tests in my project I am seeing a result "Not executed" for every one. I have restarted my computer so I doubt this is some kind of hung process issue.

谷歌没有透露任何信息.有人有什么想法吗?

Google has revealed nothing. Does anyone have any ideas?

推荐答案

多好的 PITA!IDE 没有显示任何错误.为了确定错误,您必须这样做

What a PITA! The IDE doesn't show any errors. In order to determine the error you have to do this

  1. 打开 Visual Studio 命令提示符
  2. 切换到测试项目的二进制输出所在的目录.
  3. 输入 mstest/testcontainer:The.Name.Of.Your.Test.Assembly.dll

在输出的底部,您将看到以下文本

At the bottom of the output you will see the following text

Run 存在以下问题:

Run has the following issue(s):

就我而言,它是以下内容:

In my case it was the following:

无法排队测试运行'Peter Morris@PETERMORRIS-PC 2009-02-09 10:00:37':测试运行部署问题:文件或目录的位置'C:\SomePath\SomeProject.Tests\bin\Debug\Rhino.Mocks.dll' 不受信任.

Failed to queue test run 'Peter Morris@PETERMORRIS-PC 2009-02-09 10:00:37': Test Run deployment issue: The location of the file or directory 'C:\SomePath\SomeProject.Tests\bin\Debug\Rhino.Mocks.dll' is not trusted.

现在如果 VS 在 IDE 中告诉我这个,我可以在几分钟内修复它!您所要做的就是打开 Windows 资源管理器并找到该 DLL.右键单击它并转到属性".然后点击取消阻止"按钮.

Now if VS had told me this in the IDE I could have fixed it in minutes! All you have to do is open Windows Explorer and find that DLL. Right-click on it and go to Properties. Then click the "Unblock" button.

完全是在浪费我的时间!

What a complete waste of my time!

这篇关于为什么我的所有 Visual Studio 测试结果“未执行"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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