我有一个 Visual Studio 2008 的单元测试,但我遇到以下运行时错误:
Unable to set TestContext property for the class JMPS.PlannerSuite.DataServices.MyUnitTest. Error: System.ArgumentException: Object of type 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext' cannot be converted to type 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext'
我读到在将2005项目转换为2008时,VS 2008不能正确更新对UnitTestFramework的引用。我的单元测试是在2008中创建的,但它继承自VS 2005中构建的基类。这就是我的问题所在吗?我的基类是否必须在2008中重新构建?我不想这样做,因为它会影响其他项目。
在其他派生的2005单元测试中,我们只需要注释掉派生单元测试中的TestContext属性。我在VS 2008单元测试中尝试过这样做,但没有成功。我也尝试了“new” TestContext属性,但是得到了不同的运行时错误。
有什么想法吗?