I'm using Visual Studio 2010 and both the assembly under test, and the assembly containing the tests target version 3.5 of the .NET framework (that corresponds to the v2 CLR).
The proble开发者_如何转开发m is that, when I created the test project, even though I choose version 3.5 to target, Visual Studio added a reference to the v4 Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly. I guess this is forcing the tests to run under the CLR 4.0.
I wish I could just ignore this issue, but there is some quirky COM interop behavior (probably the COM component's fault, over which I have no control whatsoever) when running under the v4 CLR.
I tried adding the test framework reference by hand, but I couldn't find it. Does it even ship with VS10?
Is there anything I can do, besides running these tests "manually" in a dedicated v2 console application?
This is a known issue that will be resolved in the upcoming Service Pack 1 for Visual Studio 2010 (see bullet on Unit Testing on .NET 3.5). The SP is still in Beta. As far as I know, a final release date hasn't been announced.
精彩评论