So today I installed Team Foundation Build on our Team Foundation Server. Due to the fact that our team size is less than 25 people we decided to go with a single server installation. As of right now, we only have a single project in TFS with only 3-5 active users at any given moment. That being said, the installation for the Build server was cake which is more than I can say for all the hoops that I had to jump through in order to install of the components for TFS. After the installation, I created and ran a standard build, but the build failed.
Error Message:
Solution: , Project: <YourSolutionName>, Compilation errors and warnings
<BuildLocation>\<WebApplicationProject>.csproj(477,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Turns out that this is a known Web Application Project issue.
Solution found @
http://forums.asp.net/ShowThread.aspx?PostID=12797... Issue 6 - Using TFS Team Build
The May 2006 release of Web Application Projects supports building with Team Build on a Team Foundation Server (TFS). However, you will need to manually add the "Microsoft.WebApplication.targets" file to your Team Foundation Server for it to work.
- On the computer running Team Build, navigate to the "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0" directory.
- In this directory create a "WebApplications" directory.
- Place the "Microsoft.WebApplication.targets" file in the "WebApplications" directory. This file can be found at the same location on your developer system that has been updated with the May 2006 release of Web Application Projects.
After performing these steps Team Build should be able to successfully build a web-project build with the new Web Application Project type.
Additionally, if you have an older version of a Web Application Project, you will need to add the WebApplication.targets line (shown in blue and bold) after the normal CSharp.targets or VBasic.targets line in your .csproj or .vbproj file (all new or newly migrated projects will have this line automatically).
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\
v8.0\WebApplications\Microsoft.WebApplication.targets" />
After copying the Microsoft.WebApplication.targets file the build worked perfect.
Ever since I began working with Visual Studio 2005 I have been making all of my web projects with the Web Application Project Add-In, it seems that one can easily forget that there were are a number of known issues with this great Add-In.