CurtisMitchell

IThinkTherefore, IBlog

Microsoft.WebApplication.targets not found

one comment

While setting up a non-Microsoft CI environment for an ASP.NET MVC project, I came across an interesting problem.  My build agent was unable to compile my project because it could not find the Microsoft.WebApplication.targets file, which, on the development computer is located under the C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications directory.

I wanted a quick solution, so I Googled it.  The top two sites resolved the issue by creating the path on the build server and copying the file over.  That is A solution to the problem.  I suppose another solution would be to install Visual Studio on the build agent.  But, that (borderline) defeats the purpose.

I decided to make a copy of the Microsoft.WebApplication.targets file in the folder of the solution.  Then, I opened the web project file and edited the line that points to the file.  I changed:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

to

<Import Project="$(SolutionDir)\Microsoft.WebApplication.targets" />

The project builds successfully in both environments now!

Written by Curt

February 1st, 2009 at 12:35 pm

One Response to 'Microsoft.WebApplication.targets not found'

Subscribe to comments with RSS or TrackBack to 'Microsoft.WebApplication.targets not found'.

  1. Thanks for the help, the fact that it wasn’t a standard reference confused me.

    Erichero

    19 Feb 09 at 4:45 am

Leave a Reply