Jeffrey Palermo (.com)

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Enabling team development with VS2008/2005 mix

Ok.  Now we have a problem.  Some folks want to use VS 2008 RTM while continuing to target an existing .Net 2.0 solution.  The project files don't give us a problem, but the solution file does.  Here is the first line in a VS 2005 solution file:

Microsoft Visual Studio Solution File, Format Version 9.00

When this file is opened in VS 2008, the nice upgrade wizard comes up.  This wizard will do crazy things to our solution file, like changing the first line to:

Microsoft Visual Studio Solution File, Format Version 10.00

Joking aside, this is the ONLY difference in running a .Net 2.0 solution in VS 2008.  There is absolutely no change to the project files necessary.

Given that, it ought to be possible to have some members of the team using VS 2005 and some using VS 2008.  Why not?  One way to accomplish this is to have two solution files in the source code trunk.  The files will be identical except the version number.

Below, I've provided two solution files for my NHibernate demo trunk.  You can use TortoiseSVN to checkout this trunk to try it out if you wish.

Note that you will have to pick one of these solution files for your automated build.  I'd recommend typing your automated Nant build to the VS 2005 solution and keeping that as the gold standard because, after all, your continuous integration server should only have .Net 2.0 installed if that's what you are targeting.  The members of the team using VS 2008 will have to ensure the VS 2005 solution gets any solution modifications that are necessary.  Both the local and CI build should use the VS 2005 solution file.  With that policy, team synchronization won't suffer.


Posted Wed, Nov 21 2007 2:26 PM by Jeffrey Palermo

[Advertisement]

Comments

cmyers wrote re: Enabling team development with VS2008/2005 mix
on Wed, Nov 21 2007 4:01 PM

My experience:  It will 'upgrade' your CSPROJ files, but not in an incompatible way. 2005 can still load them.

EXCEPT for the Web Application projects. It *WILL* make a breaking change to those. Steve Harman has a workaround: http://tinyurl.com/3atdxe

stevienova.com » Blog Archive » links for 2007-11-22 wrote stevienova.com » Blog Archive » links for 2007-11-22
on Thu, Nov 22 2007 1:25 AM

Pingback from  stevienova.com  » Blog Archive   » links for 2007-11-22

Mike Chaliy's Blog wrote Solution від VS2005 в VS2008
on Thu, Nov 22 2007 6:10 AM

Мабуть вже всі знають що в VS2008 тепер новий повністю новий формат файлу рішення (solution). Формати

Daniel Moth wrote re: Enabling team development with VS2008/2005 mix
on Sat, Nov 24 2007 6:30 AM

Note that your VS2008 users will still have to be careful not to use C#3.0/VB9 features (which are of course usable against v2.0 of NetFx, but not understood by VS2005).

Jeffrey Palermo wrote re: Enabling team development with VS2008/2005 mix
on Sat, Nov 24 2007 4:09 PM

@Daniel,

You are absolutely correct, but that is why it is important to keep the local developer build and the CI build tied to the .Net 2.0 msbuild.exe so that if someone accidentally uses a non-supported syntax, the continuous build will catch it right away even before the developer has a change to commit the change to subversion.

Carel Lotz wrote re: Enabling team development with VS2008/2005 mix
on Mon, Nov 26 2007 3:46 AM

A concern I have is that VS 2008 installs SP1 for .NET Framework 2.0.  You therefore may run into scenarios where things work in your local VS2008 developer sandbox but not on the build server.  Highly unlikely I agree, but still something to consider.  Do you therefore install .NET Framework 3.5 also on the server to get SP1 for .NET 2.0?  I haven't checked, but is .NET 2.0 SP1 available as a separate download?  I don't want to make .NET 3.5 a pre-requisite just to get SP1 for .NET 2.0 installed.  

From the software development trenches wrote Further Thoughts on Adopting .NET Framework 3.5 and VS 2008
on Tue, Nov 27 2007 11:07 AM

In my current role as .NET technology consultant I am trying to do all the pre-work required to get the

Jeffrey Palermo [MVP] wrote Running VS2008 & VS 2005 side by side - project file difference
on Wed, Nov 28 2007 1:22 AM

Previously, I posted how to support developers running Visual Studio 2008 and Visual Studio 2005 on the

Petar Repac wrote re: Enabling team development with VS2008/2005 mix
on Wed, Nov 28 2007 8:22 AM

@ Carel Lotz

> I haven't checked, but is .NET 2.0 SP1 available as a separate download?

It is. Look at:

www.microsoft.com/.../details.aspx

jankyBlog wrote La Solution in VS2005 e in VS2008
on Wed, Nov 28 2007 9:31 AM

La Solution in VS2005 e in VS2008

Carel Lotz wrote re: Enabling team development with VS2008/2005 mix
on Thu, Dec 6 2007 4:37 AM

> after all, your continuous integration server should only have .Net 2.0 installed if that's what you are targeting.

MSBuild allows you to specify a TargetFrameworkVersion property by which you can force compiler errors to be generated for code that are using features not supported by the specific version of the .NET Framework, i.e. if you create an application with some LINQ queries, the following creates compile errors:

msbuild ConsoleApplication1.csproj /ToolsVersion:3.5 /p:TargetFrameworkVersion=v2.0 OR

msbuild ConsoleApplication1.csproj /ToolsVersion:3.5 /p:TargetFrameworkVersion=v3.0

However, the following compiles successfully.

msbuild ConsoleApplication1.csproj /ToolsVersion:3.5 /p:TargetFrameworkVersion=v3.5

This allows me to still take advantage of the new improved build features like parallel builds in MSBuild 3.5.

Devlicio.us