2

I realise that Visual Studio 2010 sp1 allows test projects to target 3.5 now. However, for various reasons I don't fully appreciate, our test projects still target dot net 4.0.

The general question is in the title. How big is the risk?

Specifically, this presumably means that the tests will run in the CLR v4, whereas many of our clients will be using CLR v2. Also, the tests seem to use v4 of library components (such as System.Data), even though the application is built against v2.

One method (System.Data.SqlClient.SqlBulkCopy) contains a bug in v2 which has been fixed in v4. Our testing missed this.

Leaving aside the CLR, how can I force my application to use v2 of some library, even when it is referenced by (loaded into the app domain of) a v4 test assembly? I've been experimenting with an example, and can't seem to make it happen. My 3.5 App references System.Data v2, and echos the assembly version number to the console. When called from a 3.5 test assembly, the version is 2.0. From a 4.0 test assembly, the version is 4.0. ("Specific Version" is set to true in the reference from my App)

1

2 Answers 2

0

This should give you what you need:

In-Process Side-by-Side Execution

0

I don't have an answer to this, so we've decided to side-step the issue by reverting our test projects to dotnet 3.5. This means that tests run under the CLR 2.0. However, we still use MSTest from VS2010, and are still able to use nifty 2010 features such as test categories and data driven tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.