MSB4019 error on newly built TFS 2010 beta 2 build server
On a newly configured TFS 2010 build server that I have been creating for a demo, I experienced an error that has been an old friend for all of the previous versions of Team Foundation Server.
The error that was shown in the Summary screen was;
C:\Builds\1\BuildTest\Corp\Sources\Projects\Corp\Corp\Corp.vbproj (203): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.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.
When you click “View Log File”, the information provided is far more useful.
Project "C:\Builds\1\BuildTest\Corp\Sources\Projects\Corp\Corp.sln" (1) is building "C:\Builds\1\BuildTest\Corp\Sources\Projects\Corp\Corp\Corp.vbproj" (2) on node 1 (default targets).
C:\Builds\1\BuildTest\Corp\Sources\Projects\Corp\Corp\Corp.vbproj(203,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.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.
My demo TFS build server was a Windows Server 2008 R2 (x64) machine with TFS 2010 Beta 2 installed. I did NOT have Visual Studio 2010 Beta 2 installed on the same machine. (If I did, the problem would not have existed)
The Solution
The solution, as it has been on prior version of TFS, was to simply copy the necessary build targets from a client machine with Visual Studio 2010 Beta 2 installed. In my case I copied the following.
FROM VS2010 BETA 2 CLIENT
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\*.*
TO TFS2010 BETA 2 BUILD SERVER (x64)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0
If you are using a 32bit build server, remember the path does not include the (x86) part in Program Files.

