views:

315

answers:

1

On a brand new Vista machine, I'm getting the following error - instantly - whenever I try to start a project in debug mode:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I don't buy the "other memory is corrupt" part of the message. I thought the error might be related to a project I'd just moved to the new machine, but even a brand new blank project exhibits the same behavior. And I don't get any message when I Start Without Debugging.

I've read online about a few fixes:

  1. There was a service pack to .NET 2.0 in 2007 that addresses the issues. I'm on 3.5 SP1, so I doubt that's the problem.
  2. Compile explicitly for x86, because the DLLs you reference are 32-bit and you'll have issues. I'm on a Core 2 Duo, but running Vista 32-bit, so that shouldn't be a problem, right? (Plus, in the test project, no DLLs.)
  3. Under debug, uncheck "Suppress JIT optimization on module load". Didn't do anything for me.
  4. Wipe the whole OS and reinstall VS2008. (This apparently worked for a kid.) I don't have time for that right now.

I can probably do what I need to do without Debugging, but I'd sure like to have it back. If anyone here can think of why this might be happening, please let me know. Thanks.

+1  A: 

Another thing you can try is todo the following IF it is a web project. in the web.config file specify the following:

<system.web>

<trust level="Full"/>

</system.web>

Although that is not ideal, if it works then you can start narrowing down the issue. The error you are being given is a very generic error and may also be caused by DEP (Data Execution Prevention). From what I understand, thats usually only on Windows Server 2003. If you are on Windows2003 you can do the following to disable DEP:

  1. Right click My Computer and click Properties
  2. Click the Advanced tab
  3. Click the Settings button in the Performance section
  4. Make sure the radio button labeled “Turn on DEP for all processes and services except the ones I select” is checked
  5. Click Add at the bottom of the list
  6. Browse to the executale that they are going to run and select it
  7. Make sure the checkbox next to the executables name in the list is selected and click OK

The final option is that it could maybe also be an error when querying a database. In that case you need to check the query/oledb command parameter type/values/order of oledb parameters properly.

I hope that one of these solutions helps you! Good luck!

FailBoy
Thanks for typing this up. Further weirdness plagued the laptop, and so I'm having it reimaged. Crazy.
dnord
not a problem! Sometimes the only solution is to redo the pc sadly. Cheers!
FailBoy