Visual Studio 2008 crashes with a DEP exception after debugging an application

Posted by

I've had this really annoying problem for a while now where, if I attach to a process with Visual Studio 2008 to debug it, and then exit the application, Visual Studio would crash with a DEP exception

It was maddening and not just because I had to restart Visual Studio every time it crashed, but it also "forgets" all the window customizations, etc that I did before the crash. I don't know why developers choose to only save application configurations on a "normal" exit - why not save them when I make them? Anyway, that's a rant for another day.

The fix was pretty simple: disable DEP protection for the devenv.exe process. Simply fire up the command prompt as an Administrator, CD into your %VSROOT%\Common7\IDE folder and run the following command:


C:\...\Common7\IDE> editbin.exe /NXCOMPAT:NO devenv.exe

(It shouldn't trash your install, but you might want to make a backup of devenv.exe first)

That fixed the problem for me!

Now, presumably it's actually one of my Visual Studio add-ins that is crashing and not Visual Studio itself, but I couldn't be bothered to figure out which one it was an uninstall it (or report the problem to the maintainers). I'm just writing this post in case anybody else runs into the same problem...

I guess this also speaks to the problem with DEP in general - especially when your application is designed to run with add-ins - you need to make sure all code your application executes is DEP-aware before you set the NXCOMPAT flag in the image and you clearly can't do that with add-ins. You just gotta hope the add-in developers know what they're doing ;)

blog comments powered by Disqus