Visual Studio user-mapped section open.

visual-studio-2013-logoAs one of the solutions I’m working is getting larger and larger (50+ projects), Visual Studio sometimes “forgets” to let go of its own handles:

Unable to copy file “obj\Debug\YOURASSEMBLY.dll” to “bin\Debug\YOURASSEMBLY.dll”. The requested operation cannot be performed on a file with a user-mapped section open.

I don’t know what a user-mapped section is to be honest, but after some digging and trying I found out that VS was still holding file locks on those DLLs and trying to open another handle to them – not working of course.
I first tried restarting VS using the good old motto “Have you tried turning it off and on again?”. It seemed to work, however, after 1 successful build, the same error popped up for another assembly.
Eventually, this is the way to avoid the error (for a while): clean your solution when the error comes around. Then, restart Visual Studio. Before you do anything else when it starts up, clean the solution again to make sure the files can be deleted.

If anyone finds the reason behind all this, please let me know.

Update: this does not solve my problem all the time.

Update 2: another user reported this as being a possible issue with Visual Studio Achievements, which I also have installed (Forum)
With the extension disabled, the error went away.

About these ads

6 thoughts on “Visual Studio user-mapped section open.

  1. The same problem with same error message and posted on
    stackoverflow com/questions/9011177/the-requested-operation-cannot-be-performed-error-when-compiling-an-xna-project

  2. Thanks for that… Visual Studio Achievements was (at least part of) the issue for me. I would never had thought of that. That’s some great extension from Microsoft!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s