0

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 problem 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?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
  • What do you mean with '3.5 corresponds to v2 CLR'? And what is 'v2 CLR' anyway? Maybe .NET framework 2.0? And how does this then correspond to 3.5? Please clarify your question a bit more. – Thomas Weller Jan 13 '11 at 11:43
  • @Thomas: It seems clear enough to me... .NET 3.5 uses the v2.0SP1 CLR (JIT, GC etc) whereas .NET 4 uses the v4 CLR. – Jon Skeet Jan 13 '11 at 11:44
  • @Thomas: No, I mean, .NET 3.5 runs on CLR 2.0. See this answer: http://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c/247623#247623 . Yes, it is very confusing. – R. Martinho Fernandes Jan 13 '11 at 11:46

1 Answers1

2

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.

Aaron Marten
  • 6,548
  • 1
  • 32
  • 41