Not a subscriber?

Join thousands of others who are building self-directed lives through creativity, grit, and digital strategy—breaking free from the 9–5.
Receive one free message a week

TFS Build Not Publishing Web Applications

_PublishedWebsites does not exist?! WHAT?! Huh?

One of our TFS builds was succeeding and a fellow developer noticed that the Web App was not getting copied into the _PublishedWebsites folder of our drop location.

I took a look at our TFSBuild.Proj file and I didn’t see anything that stood out. I took a look at a similar project who’s output was being copied into the _PublishedWebsites directory and the .proj file matched that of the one that did not work.

Solution

The problem was not in the .proj file, but in the actual .csproj file for the Web Applicaiton Project.

.csproj files ARE MSBuild files and inside of that I saw this:

<Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
<!–<Import Project=”$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets” />–>

The second Build target file was not getting loaded.

This build target file contains a target by the name of “_CopyWebApplication” which takes the output of the web application and copies it to the _PublishedWebsites directory.

I uncommented this line, checked it back into TFS and re-ran my build and my _PublishedWebsites started showing up. 🙂

My file now looks like this:

<Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
<Import Project=”$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets” />