views:

256

answers:

1

I have some projects in a solution that are running on .net 3.5 SP1 (and can never ever be updated to 4.0 as they are SharePoint projects).

When I try to create a new Visual C# Test Project in VS2010 Premium, I have to choose .net 4.0 which is apparently intended.

Now I don't care about what my Unit Test project is (don't have to care about VS2008 users), but I do care if I can safely test 3.5 Projects in it due to the different CLRs and slight C# language differences?

+1  A: 

The code that you are testing can still be a .NET 3.5 project, so you don't need to worry about the C# language differences.

When you run your tests everything will be run in the CLR 4. Normally this shouldn't be an issue, however if there is an issue with SharePoint that prevents you from upgrading to .NET 4, the same issue might prevent you from running the code under CLR 4.

Daniel Plaisted
Also, if the CLR is a problem you could also use a different testing framework such as NUnit.
Adam
Thanks. I do not know if there is anything preventing SharePoint to run on CLR 4, but running it on CLR 4 means I am not testing the code that I actually run, so those Unit Tests would be worthless. (There are a ton of subtle and/or breaking changes between CLR 2 and 4) - Time to convince people not to use VSTS then :)
Michael Stum
@Michael If you want to keep using the same testing framework you could set up a VS2008 project with the same test code. Then when you want to run your tests on .NET 3.5 you would fire up VS2008 and run them there.
Daniel Plaisted