Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

MSBuild Error CSC 2012 - Access to the path is denied #4249

aorgas ·

Hello,

We recently came into this problem when it was working perfectly fine beforehand (put dummy names for privacy):

CSC : error CS2012: Cannot open 'C:\Dummy.dll' for writing -- 'Access to the path 'C:\Dummy..dll' is denied.' [C:\Dummy.csproj]

And often times its not the same .dll but differing .dlls when submitting changes via shelved changes from p4v.

Googling suggests it to be concurrency problems with multiple processors working at once, however we have multiple builds here using the same build agent and they seem to just work fine, it just seems to run into this issue with shelved changes.

Note: we call msbuild.exe via a batch file that executes things prior to launching the build.

Any suggestions for the fix?

Thanks in advance!

Edit: Added /nr:false inside our build, maybe since node reuse is enabled by default, it is locking up .dlls for copying over? Suggestions/Answers would still be appreciated!

  • replies 1
  • views 1522
  • stars 0
robinshen ADMIN ·

Multiple builds on same agent can still run concurrently if they belong to different configurations. I'd suggest to create a grid resource say "shared dll", and make it with count "1" on each agent, and then configure master step of all involved configurations to use that resource.