注意:我正在使用VS2008 SP1,我正在使用Windows 7。
我正在开发一个将在Windows CE设备上运行的Windows CE应用程序。 我创建了MSUnit测试并试图在真实设备上运行它
首次运行 - 测试运行部署问题: 测试容器直接或间接引用的程序集或模块“Microsoft.WindowsCE.Forms”
我已添加到 要部署的其他文件和目录: 此DLL。
第二轮:
无法为类TestProject1.ConfigurationServiceTest设置TestContext属性。错误:System.ArgumentException:类型为“Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext”的对象无法转换为“Microsoft.VisualStudio.TestTools.UnitTesting.TestContext”类型。
错误堆栈跟踪:
System.RuntimeType.CheckValue(对象值,Binder活页夹,CultureInfo culture,BindingFlags invokeAttr) System.Reflection.MethodBase.CheckArguments(Object []参数, Binder binder,BindingFlags invokeAttr,CultureInfo culture,Signature sig)System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,Binder binder,Object []参数, CultureInfo culture,Boolean skipVisibilityChecks) System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo文化) System.Reflection.RuntimePropertyInfo.SetValue(Object obj,Object value,BindingFlags invokeAttr,Binder binder,Object [] index, 文化信息文化) System.Reflection.RuntimePropertyInfo.SetValue(Object obj,Object value,Object [] index) Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.SetTestContext()
SmartDeviceTestRun.testrunConfig设置:
http://i.imgur.com/K5Ry2Su.png
http://i.imgur.com/gtQ6bA8.png
http://i.imgur.com/ptXd1uG.png
http://i.imgur.com/M47II2n.png
http://i.imgur.com/mInQfMV.png
如何/应该/必须在设备上正确部署/运行单元测试项目?
P.S。测试方法中自动生成的代码不会更改。