As part of my TFS (2008) build I want to manually copy the binaries and Views of an ASP.NET MVC project to a number of different locations. All existing binaries and views are copied successfully. Unfortunately, however, any newly added views are ignored during their first build. If I then start another build, they are included.
Here is a snippet of the additions I have made to TFSBuild.proj...
<ItemGroup>
<BinaryFiles Include="$(BinariesRoot)\Debug\_PublishedWebsites\SiteName\bin\*.*" />
<ViewFiles Include="$(BinariesRoot)\Debug\_PublishedWebsites\SiteName\Views\**\*.aspx" />
<ViewFiles Include="$(BinariesRoot)\Debug\_PublishedWebsites\SiteName\Views\**\*.ascx" />
</ItemGroup>
<Target Name="AfterDropBuild">
<Message Text="Starting deployment copy..." />
<Copy SourceFiles="@(BinaryFiles)" DestinationFolder="T:\BuildWebSiteHosting\WebSite\bin\" ContinueOnError="false" />
<Copy SourceFiles="@(ViewFiles)" DestinationFolder="T:\BuildWebSiteHosting\WebSite\Views\%(RecursiveDir)" ContinueOnError="false" />
<Message Text="Deployment copy completed." />
</Target>
I suspect that the list of files to copy is being built too early. Should I be using "AfterDropBuild" or is their a better target name?