Build Error - Unable to Copy File

Answered

When I start a build I have been getting the following error constantly (latest EAP as of the date of this post):

Microsoft.Common.CurrentVersion.targets(4187, 5): [MSB3021] Unable to copy file "" to "".
  The requested operation cannot be performed on a file with a user-mapped section open.


I ended up having to kill the process to start the build.  I then start the build and get the following error:

  Microsoft.Common.CurrentVersion.targets(4358, 5): [MSB3027]
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4358,5):
  error MSB3027: Could not copy "C:\...web-data.dll" to "bin\Debug\net471\...web-data.dll".
  Exceeded retry count of 10. Failed. The file is locked by: "...-web.exe (10392)"

This error happens all of the time unless I kill the running process first.  This is a show stopper for Rider.  I can consistently build, run, build, run.. within Visual Studio and it all works fine.

However, If I restart my machine and build with Rider it works fine then I can run the changes BUT when I go to build again I keep running into this.

It's NOT an acceptable route to kill a process to perform a build to test the code - this is fundamental.

Any suggestions would be welcome otherwise I'll have to go back to Visual Studio.

 

2
3 comments

Since I can't edit my original post let me specify what I am running, my apologies for leaving it out:

  • ASP.NET Core 2.x (latest, non-beta)
  • Windows 10 Pro

 

0

This issue was fixed in the latest EAP build. Could you please give it a try and let me know if the issue persists?

Thank you!

0

 Seems to be working fine, so far, all good.

0

Please sign in to leave a comment.