views:

1148

answers:

4

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?

+1  A: 

the edit-and-continue feature simply hasn't been implemented in x64 yet. I haven't heard any updates on when they plan to do it yet.

see also http://stackoverflow.com/questions/955922/why-doesnt-edit-and-continue-work-on-the-x64-clr

jcopenha
+2  A: 

Like jcopenha said there's no edit-and-continue on x64 yet. Current version of the 64bit CLR does not support it. However, there's a work around.

You can find it on Bug Babble post.

Hope it helps.

Vadim
+5  A: 

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
JaredPar
Jared, I was kind of hoping this would be cleared up with .NET 4.0 but it appears not to be the case. Would you be able to offer any insight into this?
Steven Sudit
@Steven, regretfully there's not much insight to give here. 64 bit ENC support didn't make it into Visual Studio 2010 / .Net 4 (to be fair we tackled a **lot** in 2010 and new ENC code is not cheap for either the language team or CLR). But know that MS understands lack of 64 bit ENC is a pain point and source of frustration and I imagine it's high on the list for Dev11. Please vote for this issue - http://connect.microsoft.com/VisualStudio/feedback/details/384453/enable-edit-continue-changes-to-64-bit-applications
JaredPar
Thank you, Jared.
Steven Sudit