Msbuild Biztalk Stop Applications

<

Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CheckAppExists;StopApplication;RemoveReferences;UnDeploy">

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

<

PropertyGroup>

<

AppExists>False</AppExists>

<

BTSRefApp></BTSRefApp>

<

BTServerName></BTServerName>

<

BTServerDatabase></BTServerDatabase>

<BTAppName>customercare</BTAppName>

</PropertyGroup>

<Target Name="CheckAppExists" >

<

BizTalk2006.Application.Exists Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)">

<

Output TaskParameter="DoesExist" PropertyName="AppExists" />

</

BizTalk2006.Application.Exists>

</

Target>

<

Target Name="StopApplication" DependsOnTargets="CheckAppExists" Condition="$(AppExists)=='True'">

<

BizTalk2006.Application.Stop Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />

</

Target>

<

Target Name="RemoveReferences" Condition="$(AppExists)=='True'" >

<

BizTalk2006.Application.RemoveReferences Application="$(BTAppName)" ReferenceApplications="$(BTSRefApp)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />

</

Target>

<

Target Name="UnDeploy" Condition="$(AppExists)=='True'" >

<

BizTalk2006.Application.Delete Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />

</

Target>

</

Project>