【发布时间】:2014-05-12 14:37:54
【问题描述】:
我正在使用 Visual Studio Express 2012 for Windows Phone,更新 4
我创建了针对 Windows Phone 7.1 平台的项目类型为 Windows Phone 类库 的解决方案。
完成一些编码后,我发现在解决方案中添加一些测试会很好。所以我在解决方案中添加了 Windows Phone 单元测试应用程序,并创建了一些应该失败的虚假测试:
[TestClass]
public class BogusTester
{
[TestMethod]
public void BogusTest()
{
Assert.AreEqual(true, false);
}
}
我打开了Test Explorer 窗口,我可以在其中看到我的测试,但它是灰色的,当我点击Run All 时没有任何反应(即项目正在构建但测试没有返回任何值)
我做错了什么?
编辑 我还发现了测试的输出:
Failed to import IDeployService. Cannot proceed with xap deployment. This failure can be observed if the component model cache (typically located in %LocalAppData%\Microsoft\VisualStudio\[version]\ComponentModelCache) is not up-to-date. To come out of this error, close all instances of visual studio, delete the component model cache folder and try again.
Unit tests in source D:\projekty\PhoneApp3\TestApp1\Bin\x86\Debug\TestApp1.dll cannot be run. Please create a Windows Store or Windows Phone Unit Test project.
我已经为我的用户删除了 ComponentModelCache,但这并没有帮助,我也无法在 Internet 上找到有关此错误的任何资源
【问题讨论】:
标签: c# unit-testing visual-studio-2012 windows-phone