I have a MSBuild script that deploys a web app. It stops the current web app by copying a 'app_offline.htm' file to the server. After this it deletes other files then copies new ones to the server.
I need to add a delay between the copying of 'app_offline.htm' and the delete.
My current script throws errors as the files are still locked when the script tries to delete them.
What is the best way to do this in MSBuild?
My Stop task looks like this...
<Target Name="Stop">
<WriteLinesToFile File="$(DeployDirectory)\app_offline.htm" Lines="Offline for maintenance" Overwrite="true" Encoding="Unicode"/>
</Target>
My Delete task looks like this...
<Target Name="Clean">
<ItemGroup>
<Files Include="$(DeployDirectory)\**\*" Exclude="$(DeployDirectory)\app_offline.htm" />
<Files Include="$(LogDirectory)\*" />
</ItemGroup>
<Delete Files="@(Files)" />
</Target>