Quantcast
Channel: MSBuild forum
Viewing all articles
Browse latest Browse all 2763

Visual Studio 2012 Update 3: error MSB3021: Unable to copy file during build

$
0
0

Hello,

We just upgraded our solutios to VS 2012 that contains ~100 projects each.

All projects output-paths are related to one Bin folder, so after compilation, all the assemblies and resouces are in Bin folder

We also installed the latest update of VS (Update 3)

Almost everytime we try to compile the solution(s) (by pressing F5, F6 or cntrl+shift+B) we get very wierd MSB3021: Unable-to-copy-file errors.

Most of these errors are related to resource files (png, ico, xml, etc.) that are marked as Build Action:Content and Copy if newer. Here is an example of the error we get:

Error 3 Unable to copy file "C:\...\ProjectA\Configuration\Demo.Config.xml" to "..\..\..\..\..\Binaries\Bin\Configuration\Demo.Sys.Config.xml". Access to the path '..\..\..\..\..\Binaries\Bin\Configuration\Demo.Sys.Config.xml' is denied. 

This error came from Project-B (that somehow tries to copy theresources of ProjetcA?? Why??)

I tried the following steps to overcome the errors without luck:

  • Changed content resources from Copy Always to Copy If Newer
  • Changed Project reference Copy Local from True to False
  • Changed MSBUILDDISABLENODEREUSE to 1 accroding to this

Non of the above fix this bug

Developers that still use VS 2010 don't getthese errors when building the same solutions, so this is VS 2012 issue.

Developers that use 2012 need to compile the soluition(s) 3-5 times to remove all these errors. Because of this they rather downgrade to VS 2010.

This issue must be resolved for us to move to 2012. I appreciate anybodys help on that.

Thanks!

Roy


R.R


Viewing all articles
Browse latest Browse all 2763

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>