MSBuild (.NET 4.0) access problems

Posted by JMP on Stack Overflow See other posts from Stack Overflow or by JMP
Published on 2010-05-19T20:42:24Z Indexed on 2010/05/19 20:50 UTC
Read the original article Hit count: 3053

I'm using Cruise Control .NET as my build server (Windows 2008 Server). Yesterday I upgraded my ASP.NET MVC project from VS 2008/.NET 3.5 to VS 2010/.NET 4.0. The only change I made to my ccnet.config's MSBuild task was the location of MSBuild.exe.

Ever since I made that change, the build has been broken with the 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 declaration is correct, and that the file exists on disk.

This file does, in fact, exist in the location specified (I solved a problem similar to this when setting up the build server for VS2008/.NET 3.5 by copying the files from my dev environment to my build environment).

So I RDP'ed into the build machine and opened a command prompt, used MSBUILD to attempt to build my project. MSBUILD returns the error:

MSB3021 - Unable to copy file "obj\debug....dll". Access to the path 'bin....dll' is denied.

Since I'm running MSBUILD from the command prompt, logged in with an account that has administrative privileges, I'm assuming that MSBUILD is running with the same privileges that I have.

Next, I tried to copy the file that MSBUILD was attempting to copy. In this case, I get the UAC dialog that makes me click the [Continue] button to complete the copy.

I'd like to avoid installing Visual Studio 2010 on my build machine, can anyone suggest other fixes I might try?

© Stack Overflow or respective owner

Related posts about msbuild

Related posts about cruisecontrol.net