Tuesday 4 September 2007

Visual Studio 2005 and Orcas co-existing, running Web Application Projects

Continuing my series of how to make Visual Studio 2005 and Visual Studio Orcas co-exist, and how Framework targeting works.

There is one further change required for web application projects:

Before conversion:



<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" />


After conversion:



<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />


If you try this on a machine without VS.NET 2008 Beta 2 installed the project will fail to load because it cannot find the v9.0 path being referred to. The solution is to alter the converted line and replace it (using Notepad) with:



<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" Condition=" '$(Solutions.VSVersion)' == '8.0'" />

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition=" '$(Solutions.VSVersion)' == '9.0'" />


This way the correct version of the Web Application Projects targets will be loaded depending on the version of VS.NET you are using.

UPDATE:
This does however knacker MSBuild (arrrgh), so the best method is to modify this file in a custom task in TFS (which i guess I will create on monday)

Thanks goes to Tom Blackburn on this one

3 comments:

Azhar Saiyed said...

how can i implement silverlight 2.0 with my VS 2.0 webapplication

Anonymous said...

how can i implement silverlight 2.0 with my VS 2.0 webapplication

chrishayuk said...

You really should be using Visual Studio 2008 to develop Silverlight applications.

You can download Visual Studio 2008 trial edition and then include the Silverlight application as part of your existing .NET 2.0 Website.

I believe in the future Silverlight 2.0 will be supported in the express editions of Visual Studio. So I think the trial edition should be able to help you out until that happens