The requested operation cannot be performed on a file with a user-mapped section open The requested operation cannot be performed on a file with a user-mapped section open windows windows

The requested operation cannot be performed on a file with a user-mapped section open


In my case it was the Explorer that was locking the DLL that was been compiled in the Debug folder... Strange, isn't it?

I found out using a tool called Unlocker.

Had to delete with Unlocker, even when it was saying that there was no lock over the file, and I couldn't delete the folder until I didn't delete that single file...

After that it compiled.

EDIT:

I found out why in my case this was happening. I had the DLL opened in a text editor inside Visual Studio...


  • Sometimes when you double click on a warning about the referencedassembly version mismatch between two or more projects you forget toclose the assembly view window and it stays there among othertabs... so you end up with the assembly being locked by VSitself and it took me quite a lot of time to figure that out :)

    Be careful with the power VS provides ;)

  • Another dummy scenario. Sometimes simply deleting the whole objfolder or just the file warned as the locked one helps out with thiscrappy error.


close all documents on VS and try to rebuild again. If it doesn't work restart VS. This problem is related to lock of DLL files.