views:

24

answers:

1

When I remove a reference to a project in Visual Studio 2008 I receive the following error message in a dialog box:

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

Once I click "OK" to exit the message box, Visual Studio shuts down completely. I'm running Visual Studio on a Windows 7(x64) machine.

How do I stop this from happening?

+1  A: 

This is a hack but you might try removing the reference by editing the project file or solution file with a text editor and then open the project again. Be sure to backup first.

Look for <ProjectReference Include=" or <Reference Include=" in the project file and remove the one you need to get ride of.

Look for Project ... EndProject in the solution file

Tim Santeford
I could do that...but it doesn't solve my problem as to why the editor is crashing when I do such as simple function.
Achilles
It looks like people have this problem when referencing Office Introps and or reference the wrong version of a third party library (meaning VS2008 thinks the libraries version is 4.1 but actually the dll is version 4.2). I would make a copy of your solution then manually remove references and then re-add them from within VS. There is a good chance that after doing this your problem will be fixed and you will be able to add/remove reference normally again.
Tim Santeford