CSC : error CS2012: Cannot open 'File name and path' for writing -- 'The process cannot access the file 'File name and path' because it is being used by another process.'
This has been an intermittent problem that appears to be worsening. We are using MSBuild via dotnet.exe. These builds are all .NET Core. This occurs with both 1.0 and 1.1. We are using plugin ".NET Core Support" version 0.8.1.
We are not able to determine the cause of this error. Any suggestions are welcomed.
Please sign in to leave a comment.
Hi Gerald,
This usually happens when third party software interacts with some of the generated files (backup systems, antivirus, etc). It might help if you could, when it happens, determine which process is locking the file: https://superuser.com/a/399660
Hi Denis,
Thanks for getting back to me. We white listed the parent folder with the antivirus and anti-malware software. To my knowledge there is nothing else installed on this box. We could run the build right away and all is well. This is perplexing.
Hi Gerald,
if you run a google search, this error happens rather often (not just on teamcity), and it can be intermittent. If it shows up again, please check which process is blocking the files, if it's something tied to teamcity, please report back to see if we can check.
Found same error in the configuration where both TeamCity and Agent instaled in docker containers. Each placed in it's own container. There were no special errors can halp resolve issue.
Any ideas?