C# – “Changes to 64-bit applications are not allowed” when debugging in Visual Studio 2008

64-bitcedit-and-continuevisual studio

I'm using Visual Studio 2008, C#. I try to use edit-and-continue (edit the code while debugging), and get this exception:

"Changes to 64-bit applications are not allowed"

Why is that? Is there a workaround?

Best Answer

Edit and Continue is not supported on 64 bit applications at the CLR level so there is no way for Visual Studio to implement it either.

The easiest way to work around this problem is to target your application to x86 chips. This will cause it to run in Wow64 mode as a 32 bit process and hence be able to ENC. You can do this by doing the following

  1. Right click on the .EXE application and choose Properties
  2. Go to the Build Tab
  3. Change the Platform Target combo box to x86

enter image description here