CSC error CS0016: Access is denied
CSC error CS0016: Could not write to output file 'd:\BuildAgent\work\6498d93ace9e01ff\.....\obj\Release\XYZ.dll' -- 'Access is denied. '
I get the above error once in a while. I use msbuild to builds the projects through TeamCity.
Please sign in to leave a comment.
The file is probably locked by some parallel process.
Does it happen when you start MSBuild outside of TeamCity?
I ran it on my local machine with the max cpu count as 3. Now it ran fine. But occassionally it fails when using TeamCity Build agent. It has not been failing from couple days again.
I would suggest to take Process Monitor and watch what processes access this file