tag:help.appveyor.com,2012-11-13:/discussions/problems/6789-every-build-fails-with-cannot-open-file-for-writingAppVeyor: Discussion 2018-10-19T08:18:22Ztag:help.appveyor.com,2012-11-13:Comment/426986982017-06-05T14:10:43Z2017-06-05T14:10:43ZEvery build fails with "Cannot open file for writing"<div><p>Ho Bojan,</p>
<p>I cloned your repo and was able to reproduce the issue. Then I added <a href="https://www.appveyor.com/docs/how-to/rdp-to-build-worker/">RDP</a> at both <code>install</code> and <code>on_finish</code> stages, connected to the build worker and installed <strong>Process monitor (procmon)</strong> manually at install stage. Then continue the build and started monitoring <code>C:\projects\pingu\src\Pingu\obj\Debug\netstandard1.3\Pingu.dll</code>. Attached picture shows what I see during error reproduction.</p>
<p>As you may notice if you look at <code>dotnet</code> process ID (PID), it seems to compete with another instances of itself. I believe that this is some issue with <code>dotnet build</code> multi-threading. I could not find how to disable it to proof this theory. However if I do <code>appveyor-retry dotnet build -c Release</code> it works OK.</p>
<p>This is not ideal solution, but it should unblock you now.</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/426986982017-06-05T14:12:29Z2017-06-05T14:12:34ZEvery build fails with "Cannot open file for writing"<div><p>Strange. Thanks for the info, I'll work around it for now, though I do wonder why it doesn't happen on other builds.</p></div>Bojan Rajkovic