Msbuild Publish WebServices

<

Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="PublishSite">

<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />

<

PropertyGroup >

<

MsgFailed>Failed PublishWebSite for </MsgFailed>

<

MsgSuccess>success PublishWebSite for </MsgSuccess>

<

AppPoolName>DefaultAppPool</AppPoolName>

<

WebSiteName>Default Web Site</WebSiteName>

<

WebSiteHost>mymachinename</WebSiteHost>

<

WebService Include="MyWebService">

<

WebSitePath>C:\Inetpub\wwwroot\SampService</WebSitePath>

<

TFSPath> C:\Development\Store\SampWebService\</TFSPath>

</

WebService>

</PropertyGroup>

<

Target Name="PublishSite" >

<

Web.WebSite.DeleteVirtualDirectory

VirtualDirectoryName="$(WebService)"

MachineName="$(WebSiteHost)"

WebSiteName="$(WebSiteName)"/>

<

AspNetCompiler Clean ="true"

PhysicalPath ="$(TFSPath)"

TargetPath ="$(WebSitePath)" VirtualPath ="/$(WebService)"

Updateable ="false" Force="true" ></AspNetCompiler>

<

Web.WebSite.CreateVirtualDirectory

VirtualDirectoryName="$(WebService)"

Path="$(WebSitePath)"

MachineName="$(WebSiteHost)"

AppPoolID="$(AppPoolName)"

WebSiteName="$(WebSiteName)"

/>

<

OnError ExecuteTargets ="HandleErr"/>

</

Target>

<

Target Name="HandleErr" >

<

Message Importance ="high" Text ="$(MsgFailed) : $(WebService)" ContinueOnError ="true" ></Message>

</

Target>

</

Project>