Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Mixing Visual Studio 2008 and 2010

Mixing Visual Studio 2008 and 2010

Leia em Português

This item in japanese

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