Attempted to read or write protected memory.

Before I begin, here is my setup:

  • Running Windows 7 Pro 64-bit inside a VirtualBox 4.0.4, the HOST operating system is Ubuntu 10.04.2
  • Microsoft Visual Studio 2010 Version 10.0.30319.1
  • Microsoft .NET Framework Version 4.0.30319

So folks, wtf does that error mean?

Just minding my own business, trying out some C# ASP.Net MVC3 tutorials, when BAMM! WACK! ZOW! I get this error: “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

Attempted to read wright protected memory

I should mention it happens AT RANDOM.  I cannot narrow it down to one scenario that causes the issue.  I have also tried different MVC3 projects, and same thing occurs at random 😦

I tried to Google the issue, naturally, but no luck.  The most useful bit of advise I could find was to SWITCH TO IIS, instead of using Visual Studio Development Server.

Click here to see a screenshot for changing Visual Studio Project to use IIS.

This is a workaround that solved the issue for me, but if anyone knows the root cause please leave a comment.  I hate workarounds when I don’t know why they work.  But hey, I’m still going to use it 🙂

In the meantime, I hope this helps someone, cause I spent alot of time searching :/

End of Line.

, ,

  1. #1 by Daniel Tucker on February 24, 2012 - 17:03

    I am struggling with this same issue. I found a virtualbox ticket for it: but it doesn’t say to do anything more than changing to a single processor to help it be less noticeable.

  2. #2 by Anonymous on July 13, 2012 - 20:46

    I’m not really sure about this but i solved this issue starting Visual Studio as Admin.

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: