I came across this issue while trying to add a web application to my Continuous Integration (CI) server. I use CruiseControl.NET (CCNet). My server does not have Visual Studio installed on it and nor do I want it installed. The server only has the .NET Framework installed, versions 2.0, 3.0 and 3.5. In addition I have Subversion and NUnit installed. All great tools and free!
I had already successfully, added a console application to the CCNet build process and thought that adding a web application would be pain free. Silly me! Actually it wasn't too bad.
CCNet was reporting the following error. The actual error was generated by MSBuild.
gtanetws\gtanetws.csproj (,): warning MSB4122: Scanning project dependencies for project "gtanetws\gtanetws.csproj" failed. The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.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. C:\ccnet\projects\gtanetws\src\gtanetws\gtanetws.csproj
For some reason the download for the .NET Framework excludes this critical file that is necessary to build web applications. The solution is fairly simple;
- Go to a computer that already has Visual Studio installed. Make sure you use the correct version. For example, if you are using .NET Framework 3.5 then you will need to using Visual Studio 2008 (V9.0). The instructions assume you are using for .NET Framework 3.5 for the build server
- Copy all the files from the C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications to the server and place them in the same directory. You will need to create the directory tree on the server.
That's all there was to it. You should now be able to build web applications on your build server.