Gene this what you should do:
(from
http://tinyurl.com/m3ljap8)
If you don't like to modify anything on build server, and still want project to build right out of source control, it might be a good idea to put required binaries under source control. You'll need to modify imports section in your project file to look like this:
<Import Project="$(SolutionDir)BuildTargetsWebApplicationsWebApplication.target" />
<Import Condition="false" Project="$(MSBuildExtensionsPath32)MicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" />
First line is actual import from the new location that is relative to the solution dir. And second one is turned off (Condition="false") original line, that allows for Visual Studio to still consider your project being valid Web Application Project (that's the trick VS 2010 SP1 does itself).
Don't forget to copy C:Program Files (x86)MicrosoftVisualStudiov10.0WebApplications to BuildTargets folder under your source control.