尝试加载测试资源管理器时,Visual Studio 2012 中的简单项目导致以下错误:
------ Discover test started ------
Exception has been thrown by the target of an invocation.
========== Discover test finished: 1 found (0:00:00.152) ==========
这是我的测试项目:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MyApp
{
[TestClass]
public class MyTests
{
[TestMethod]
public void Test()
{
var foo = 1;
Assert.AreEqual(1, foo);
}
}
}
由于某种原因,测试资源管理器没有发现我的测试。它可能归结为在我的问题的顶部提出的异常(exception)。有谁知道这是否是 Visual Studio 2012 中的错误。不明白为什么这么简单的事情会炸毁它?!?
最佳答案
为 Visual Studio 2012 安装 SP3 后,错误似乎消失了。
关于visual-studio-2012 - Visual Studio 2012 - 调用目标引发了异常。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16232731/