我有一些单元测试在我的开发机器上运行良好,在 Win Mobile 5 和 6(专业版)模拟器上运行。
在构建服务器上运行某些单元测试失败,但仅在 Win Mobile 6 模拟器上运行(所有测试都在 Win Mobile 5 模拟器上通过)。
失败的测试有如下错误:
Test method XXXXXMobile.Test.ManifestTests.TestCrewManifest threw exception: System.MissingMethodException: Could not load type 'XXXXXMobile.Controllers.ManifestController' from assembly 'XXXXXMobile.Controllers, Version=1.0.4049.32739, Culture=neutral, PublicKeyToken=null'..
和
Test method XXXXXMobile.Test.PermissionTests.TestMenuBarPermissions threw exception: System.MissingMethodException: Method not found: op_Implicit System.Object..
启动测试的命令行是:
C:\hudson\jobs\XXXXX Mobile (WinMobile 6 Emulator Tests)\workspace>e:\VS9\Common
7\IDE\MSTest.exe /runconfig:YYYY\WinMobile6Emulator.testrunConfig /testcontainer
:YYYY\XXXXXMobile.Test\bin\Release\XXXXXMobile.Test.dll
testrunconfig 文件并不令人兴奋。我认为我从默认更改的唯一内容是: - 启用部署:选中 - 主机类型:智能设备 - 平台:Windows Mobile 6 Professional SDK - 设备:Windows Mobile 6 Professional Emulator
包含测试运行容器 dll 的目录还包含上面第一个错误中提到的 Controllers dll。
一段时间以来,我一直在努力解决这个问题,我不知道为什么只有一些测试失败并且只在一台机器和一个模拟器上失败。通过在 MSTest.exe 和 VSTestHost.exe 上打开诊断日志记录,我无法获得更多有用的错误消息。
任何建议都非常感激。