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)