Question

I'm building a project in Visual Studio 2010 and the build fails because it cannot copy the assemblyname.dll file from obj to bin folder. The exact error message is:

Error 7 Unable to copy file "obj\Debug\AssemblyName.dll" to "bin\AssemblyName.dll". The requested operation cannot be performed on a file with a user-mapped section open.

I think this is because the previous file in bin-folder is not accessible. When I try to delete the file manually, I get an error "The action can't be completed because the file is open in another program". If I try to see what application locks the file with Unlocker, I don't get any results (No Locking handle found).

If I restart Visual Studio, the error goes away but happens again after a build or two. Goes without saying that this is seriously slowing me down. Any advice how to start solving this?

Was it helpful?

Solution 2

This behavior was due to a newly installed Visual Studio extension called Visual Studio Achievements (http://visualstudiogallery.msdn.microsoft.com/bc7a433b-b594-48d4-bba2-a2f24774d02f)

I noticed that the .pdb file was locked by FxCop (using Unlocker) and I think that the Achievements -extension uses it. After disabling the extension I've no longer got the error mentioned above.

OTHER TIPS

VIsual Studio 2012 on Windows 8. I was receiving the same error message on my project. Restarting Visual Studio or cleaning the obj folder manually did not help. Finally I closed all open files (Windows -> Close All Documents) and the problem went away.

This bug has been fixed in recent versions of the extension (>1.7). It was released as a beta, btw...

This behavior of VS happen very often even on my computer (and on computers of my coworkers).

In my experience it happen more frequently when:

  • I have some form opened in design when i compile
  • I stop the execution od the application by pressing the "stop" button in VS instead of exiting the application

So, closing the form in design before compile, and exiting the application instead of stopping it, somewhat mitigate the issue... but it still happen :-|

My computer is Win 7 x64 SP1 with VS 2010 SP1, 8Gb ram, and no swap file

Platform: Windows 8 Pro, Visual Studio 2012

I found that I receive this error when I am accessing the folder in Windows Explorer.

I was creating PDF documents with Visual Studio 2012. To review the sample document I would right click in Solution Explorer and use Open Folder in File Explorer.

On Windows 7 I would get a SYSTEM.IO error if the actual PDF document was open in Adobe Reader which is expected. With Windows 8 I found that I receive the above error if I have the folder open. I suspect there is a conflict with the Windows 8 preview.

If I close the folder and run the program it works fine.

Check if you open the dll in visual studio. I open the dll in visual studio and this error happen!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top