Sebastiaan Mindreau's Blog

Visual Studio user-mapped section open.

Posted on: January 24, 2012

As 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 Responses to "Visual Studio user-mapped section open."

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

Thanks for the reply. I hadn’t found that post yet ;)

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!

Barry,
The achievements you make by using the extension are all canceled when you lose so much time with figuring out that problem. Back to business I’d say.

Actually I only spent 5 minutes figuring it out thanks to your post!

Barry, that’s exactly why I posted it, thanks for the feedback!

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 119 other followers

%d bloggers like this: