views:

150

answers:

3

We're excited at the prospect of upgrading our development IDE from Visual Studio 2008 to 2010. Our production environment, however, is not scheduled to be upgraded from .net 3.5 sp1 to .net 4.0 in the near future.

What are the possible risks in using Visual Studio 2010 to develop production grade applications that will actually run on .net 3.5 sp1 ?

+3  A: 

IMO there really aren't any credible risks IMO. I guess you could say that the risk is that someone on your team may accidentally upgrade your projects to 4.0, but then again, that's what the "svn revert" command is for. :)

You might, however, find that if you run a build server, you will have to upgrade your framework version on it, since your MSBuild copy on your build server won't recognize your VS 2010 project files. But the newer version of MSBuild has no problems back-targeting to 3.5 apps that I've seen.

Dave Markle
A: 

Targeting 3.5 (or 3.0 or 2.0) is still possible, as in vs 2008. I guess the same risk existed there if you were developing for 2.0 but used 3.0 or 3.5 features by mistake.

My advice is to go for it - we're in the same boat and it's working fine so far.

ScottE
+3  A: 

Only a few minor problem I'm aware of. A new C# project created in VS2010 will have a dependency on Microsoft.CSharp.dll, the runtime support assembly for the new "dynamic" keyword. When you change the target framework version to 3.5, you'll get a warning about this assembly, you have to remove it by hand.

Also, your code will be compiled by the new C# 4.0 compiler, even if you target an earlier version of the framework. That could be the source of a compat problem, code that compiles differently with the 3.0 compiler. The more common compat issue is code that shouldn't compile in 3.0 but did because of a compiler bug. Not a real problem of course, but could byte if you check in code that was written by team members that still use 3.0

You can force the compiler to verify that no new 4.0 features are used accidentally with Project + Properties, Build tab, scroll down/right, Advanced, Language Version = "C# 3.0".

If you want to be sure then wait another couple of months and keep an eye on the feedback at connect.microsoft.com.

Hans Passant
I have to comment on the first point: When you create a new project in VS2010, you can choose the framework version beforehand. If you choose .NET 3.5 it won't add the reference to Microsoft.CSharp.dll.Same thing if you're upgrading a project from VS2008 to VS2010.. It won't add this reference, unless you change the framework version to v4, which is done after upgrade anyway, so that's not a problem )
Artiom Chilaru