Web Deployment Projects for VS08 released as CTP & Migration tips

My old build script wasn't working after the migration to this new version and you will find in this post the different adaptation that I had to do.

Add missing ToolsVersion as following:

<Project DefaultTargets="Build" 
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets"/>


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

I also had to add the following to the beginning of my AfterBuild task:

<Target Name="AfterBuild">
  <CreateItem Include="$(TempBuildDir)\**\*.*">
    <Output ItemName="CompiledFiles" TaskParameter="Include" />     
  <Exec Command="if exist &quot;$(WDTargetDir)&quot; rd /s /q &quot;$(WDTargetDir)&quot;" />
  <Exec Command="if not exist &quot;$(WDTargetDir)&quot; md &quot;$(WDTargetDir)&quot;" />
  <Copy SourceFiles="@(CompiledFiles)" DestinationFolder="$(WDTargetDir)\%(CompiledFiles.SubFolder)%(CompiledFiles.RecursiveDir)" />
  <Exec Command="if exist &quot;$(TempBuildDir)&quot; rd /s /q &quot;$(TempBuildDir)&quot;" />

Otherwise I ended up with TempBuildDir folder with a part of my solution. This is just a copy of what is defined in Microsoft.WebDeployment.targets.

Now everything works like before, I can:

  1. set Staging as my active solution configuration
  2. Run a compilation
  3. Zip the merged result of the build
  4. Start uploading using ssh to the target stage server


About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect, certified Scrum Master and Founding Member.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent was awarded Most Valuable Professional (MVP) by Microsoft from April 2002 to April 2012.

JetBrains Academy Member
Certified ScrumMaster
My status


This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List