TeamCity 4.5. Building C#/MVC App .Net 3.5
For my targets I have Clean;Build;ClearWebProjectDirectory;_CopyToWebApplication
I defined parameters required including WebProjectOutDir=c:\inetpub\integration\site1.com\wwwroot\
ClearWebProjectDirectory Task is:
<Target Name="ClearWebProjectDirectory" Condition="'$(WebProjectOutputDir)'!=''">
<Message Text="Clearing up web project directory"/>
<WebAppFiles Include="$(WebProjectOutputDir)\**\*.*" />
<Delete Files="@(WebAppFiles)" Condition="'$(WebProjectOutputDir)' != ''" />
<Message Text="Cleared up web project directory"/>
I think the problem with Teamcity's patch (or it maybe msbuild itself - or my lack of understanding) is that its not obeying the targetting order.
ClearWebProjectDirectory always runs last as indicated in the logs looking fo Message tasks output.Which of course causes problems since its clearing out the newly copied content.