By and large making a Visual Studio 2008 project work in Visual Studio 2005 is nearly transparent - project files generally work in both versions and the only change required is on the Solution file where the file version needs to be changed:
VS 2005 (top of .sln file):
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VS 2008:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
And usually that's all it takes to move a VS 2008 project back to VS 2005.
Build Targets and Web Application Projects
However, if you're using any 'special' projects that include custom build targets you may find that although the project will open just fine on your machine it may fail on another machine that doesn't have VS 2005 or VS 2008 installed. The problem is that each version includes its own Build Targets for certain project types.
For example, Web Application Projects uses different build targets in VS 2005 and VS 2008 in the .csproj file:
VS 2005:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" Condition="" />
VS 2008:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition="" />
If you now switch a VS 2008 project back to VS 2005 it will work just fine on your machine because you will have the v9.0 targets installed. However if you install on a machine that only has VS 2005 SP1 install the V9.0 targets are missing.
I suspect there are other cases where similar rules apply. If I remember correctly the same applies to the WCF service related targets.
This is unfortunate, because it's really hard to tell whether something works or not with VS 2005, unless you have a machine that only has VS 2005 installed.
If you're distributing source code/projects/solutions to customers who may be running either VS 2005 or VS 2008 it's probably best to ship the VS 2005 solution. When that project is opened in VS 2008 it will automatically up convert and things like these build target differences are automatically applied.
For my West Wind Web Store distribution I originally had a VS 2005 and VS 2008 solution file figuring that's all it would take, but the above actually prevents me from doing so because the WAP project file requires the above change. Even if the solution points at VS 2008 opening the solution still pops up the Upgrade Wizard and this way at least you get the correct behavior.
The bad part about this is trying to remember to fix the build target. It's not good enough to open the project in Visual Studio 2005 and make a change to the project settings - the build target doesn't change in this case and remains at the VS 2008 default.
Definitely a special case scenario, but something that I've unwittingly perpetrated on some of my customers not realizing the issue <g>...
Other Posts you might also like