单元测试:VSTestHost.exe 已停止工作。 VS2008 Pro - 紧凑的框架

Unit Test : VSTestHost.exe has stopped working. VS2008 Pro - Compact Framework

尝试在 Visual Studio 2008 Pro 上的 SmartDevice 项目上执行单元测试时,出现错误 "VSTestHost.exe has stopped working"。

调试单元测试时,出现以下异常FileNotFoundException

堆栈跟踪如下:

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()

有什么建议吗?

使用这个 thread,它成功了。

I used filemon.exe and saw that for some reason the vstesthost.exe was looking for Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll in the public assemblies folder of VS 2010 (c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies) instead of VS 2008 (c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies).

Maybe not the most elegant solution, but I just copied the SmartDevice.UnitTestFramework.dll with its xml config file from the VS 2008 public assemblies folder to VS 2010 public assemblies folder and it worked for me.