5

试运行错误:

执行此测试所需的测试适配器('Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')可以不被加载。检查测试适配器是否安装正确。错误:智能设备主机适配器无法初始化。

实际情况:已知问题“辅助线程中的单元测试异常杀死 vstesthost”

已通过添加到 C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTestHost.exe.config 解决

以下行:

Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll 已添加到 GAC:

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" -i "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SmartDevice.UnitTestFramework. dll"

但我仍然收到错误消息,无法在模拟器上运行单元测试。

或者这可能是 Visual Studio 2008 的未解决问题,我应该尝试其他工具/可能性?

在此处输入图像描述

System.IO.FileNotFoundException 未处理

系统找不到文件

Source="Device Connection Manager" StackTrace:在 Microsoft.VisualStudio.DeviceConnectivity.Interop.ConManServerClass.DownloadPackage(String pwszPackageId) 在 Microsoft.SmartDevice.Connectivity.FileDeployer.DownloadPackage(ObjectId packageId) 在 Microsoft.VisualStudio.SmartDevice.TestHostAdapter.DeviceAgent。 RunConfigDevice.InitializeStreamingWithDevice() 在 Microsoft.VisualStudio.SmartDevice.TestHostAdapter.DeviceAgent.DeviceHostAdapter.initializeInternal() 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state ) 在 System.Threading.ThreadHelper.ThreadStart() 内部异常:

http://img688.imageshack.us/img688/2025/20120808testrunerrorexc.gif

4

2 回答 2

1

如果您刚刚安装了移动设备的 SDK,它可能已经安装了尚未初始化的框架。尝试重新启动。

如果您安装了多个移动 SDK(WM5、WM6.1、WM6.3.5 等),请确保您的项目正在尝试启动您的目标版本。

如果一切都失败了,您可以尝试卸载模拟器,重新启动(因为我们喜欢 Windows),再次安装,重新启动(因为它仍然是 Windows),然后返回到您的项目。

于 2012-08-08T17:41:40.547 回答
1

我在这里找到了答案:http: //social.msdn.microsoft.com/Forums/en/vssmartdevicesvbcs/thread/72fbc539-cf28-4643-b7bf-2ced70018d2e

也许不是最优雅的解决方案,但我只是将 SmartDevice.UnitTestFramework.dll 及其 xml 配置文件从 VS 2008 公共程序集文件夹复制到 VS 2010 公共程序集文件夹,它对我有用。

在我的机器上,这些文件夹是 VS2008

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies

对于 VS2010

 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies

我收到 2 条错误消息。vstesthost.exe 崩溃,并详细给出了这一行

vstesthost.exe
Microsoft.SmartDevice.Connectivity
System.IO.FileNotFoundException

或者单元测试框架抛出这个异常

"The system cannot find the file specified.\r\n"
"Device Connection Manager"
at Microsoft.VisualStudio.DeviceConnectivity.Interop.ConManServerClass.DownloadPackage(String pwszPackageId)
at Microsoft.SmartDevice.Connectivity.FileDeployer.DownloadPackage(ObjectId packageId)
at Microsoft.VisualStudio.SmartDevice.TestHostAdapter.DeviceAgent.RunConfigDevice.InitializeStreamingWithDevice()
at Microsoft.VisualStudio.SmartDevice.TestHostAdapter.DeviceAgent.DeviceHostAdapter.initializeInternal()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
于 2012-10-12T14:00:33.703 回答