【问题标题】:Unit test for UWP app failed to run on Visual Studio 2015UWP 应用的单元测试无法在 Visual Studio 2015 上运行
【发布时间】:2016-03-10 16:05:59
【问题描述】:

我在我的一台机器上运行单元测试时遇到问题,测试应用程序在几秒钟后就关闭了。这是调试测试时的输出显示:

在 UnitTestProject1.exe 中的 0x7525D8A8 处引发异常:Microsoft C++ 异常:内存位置 0x0A17C5F0 处的 EETypeLoadException。

在 UnitTestProject1.exe 中的 0x7525D8A8 处引发异常:Microsoft C++ 异常:[rethrow] 在内存位置 0x00000000。

在 UnitTestProject1.exe 中的 0x7525D8A8 (KernelBase.dll) 处引发异常:0x40080201:WinRT 发起错误(参数:0x8007274C、0x000000B9、0x0EE4F6AC)。

抛出异常:mscorlib.ni.dll 中的“System.Exception”

WinRT信息:连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应。

抛出异常:System.Private.ServiceModel.dll 中的“System.Net.Sockets.SocketException”

抛出异常:mscorlib.ni.dll 中的“System.Net.Sockets.SocketException”

抛出异常:System.Private.ServiceModel.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.ServiceModel.EndpointNotFoundException”

抛出异常:mscorlib.ni.dll 中的“System.Reflection.TargetInvocationException”

这些异常与我的应用程序完全无关,因为我的应用程序不需要互联网并且未达到测试方法中的代码。它们来自测试框架。

相同的解决方案在所有其他机器上都可以正常运行测试(相同的 Windows 10 版本)。我认为问题在于问题机器上的系统关闭了单元测试所需的一些服务。我在任何地方都找不到任何相关的东西。我应该怎么做才能解决这个问题,我不想重新安装 Windows。

【问题讨论】:

  • 我遇到了同样的问题,重新安装 VS 并没有为我解决这个问题。但和你一样,它在另一台具有完全相同的 windows/sdk/visual studio 版本的机器上运行良好。

标签: c# unit-testing windows-10 uwp


【解决方案1】:

似乎无法建立与测试模拟器的连接。当您构建 TestApp 时,请确保您已将构建配置设置为 Debug - Any CPU (not ARM) 此外,您不应通过按 F5 来运行测试项目,而应从 TestExplorer 运行测试。

【讨论】:

    【解决方案2】:

    我最终重新安装了 VS 2015,问题现在消失了。

    【讨论】:

      猜你喜欢
      • 2017-11-03
      • 1970-01-01
      • 1970-01-01
      • 2016-07-27
      • 1970-01-01
      • 2015-12-15
      • 2016-01-30
      • 1970-01-01
      • 2017-08-13
      相关资源
      最近更新 更多