BT

Mixing Visual Studio 2008 and 2010

by Jonathan Allen on Aug 11, 2010 |

Developers can upgrade to Visual Studio 2010 while other team members on the same project are still using Visual Studio in 2008. But in order to do so you need to know a few tricks such as the langversion flag.

To begin with a copy of the current solution file must be made. This is necessary because, unlike project files, solution files are not backwards compatible. Once the copy is made you can perform the usual solution upgrade as if you were permanently moving to a new version of Visual Studio.

The next step is to ensure that the upgrade process didn’t break to the VS 2008 solution. Under the tests we have run so far the only negative effect was a couple of warnings emitted during the build process.

You will have to continue using the .NET 2.0 series of libraries, but the normal target framework settings are enough to account for that. The tricky part is to avoid using any new language features from VB 10 or C# 4. This is where the langversion flag comes into play. This flag restricts the compiler to a specific version of the language. For C# that means the 2003 ISO specification, the 2006 ISO specification, or C# 3.0. In Visual Basic you can choose between VB 9 or VB 10.

C# allows you to set this flag in the Advanced menu of the Build tab. For Visual Basic you will have to manually edit the project file so that it includes the below line.

<PropertyGroup> <LangVersion>9</LangVersion> </PropertyGroup>

Please note that these instructions are primarily for class libraries, console, and Windows applications. ASP.NET projects have their own quirks and may additional issues not addressed here.

Rate this Article

Relevance
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
General Feedback
Bugs
Advertising
Editorial
Marketing
InfoQ.com and all content copyright © 2006-2016 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT

We notice you’re using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.