Fixing Visual Studio’s Edit and Continue under x64

One of the best features about developing under Visual Studio and .NET is Edit and Continue.  Many of you might not have heard this term before, but I’m sure you use it on a regular basis; it simply refers to the ability to edit your code while debugging.  This is actually a pretty amazing thing… Visual Studio rebuilds your application and then resumes execution right where you left off, but using the new code.  It’s not too different from having a mechanic rebuild your car’s engine while you’re driving along the freeway.

But, you’ll find it doesn’t work under 64-bit versions of Windows.  You’ll get this error message:

Changes to 64-bit applications are not allowed.

As it turns out, there’s a very easy fix for this: turn your application into a 32-bit one.  This is pretty unlikely to affect the way your application behaves, and it’s a very simple setting to change.  You’ll find it under Project Properties.  In VB, go to the Compile tab, click Advanced Compile Options, and look for the Target CPU setting.  Under C#, go to the Build tab and look for the Platform Target option.  Once you’ve found it, change it from “Any CPU” to “x86”.  That’s it!

Of course, you might want to consider changing this back when you’re ready to deploy your application.  While 32-bit applications will still run on 64-bit Windows, your customers will be much happier with a native 64-bit exe.  Leaving it as “Any CPU” lets the framework handle the details and make things work properly regardless of the platform.

10 comments:

  1. Your advice is good, but the situation sucks ... :)

    ReplyDelete
  2. It sure does... and you know what's even worse? Visual Studio 2010 works exactly the same way (only much slower!). Hopefully Microsoft will sort things out before RTM; x64 is now mainstream, and the state of .NET development under x64 is pretty sorry.

    ReplyDelete
  3. Please vote here to have this feature reinstated on x64:

    https://connect.microsoft.com/VisualStudio/feedback/details/559582/need-c-edit-and-continue-on-x64-native-mode

    ReplyDelete
  4. Thanks a lot for posting the solution. You actually saved me from reinstalling Windows!

    ReplyDelete
  5. Please vote here on Microsoft connect to have this feature on x64 (new feedback number as they had to reset the count)

    https://connect.microsoft.com/VisualStudio/feedback/details/661089/need-c-edit-and-continue-on-x64-native-mode

    ReplyDelete
  6. It didn't work for me. I'm using visual studio 2010 express. I changed anycpu to x86 and I still get the same error message when debuging (Changes to 64-bit applications are not allowed).
    What else do I need to do.

    ReplyDelete
  7. Our accounting services in Dubai are provided to numerous consumers in several GCC nations Accounting Services by our financial advisors as well as professionals in Dubai and Abu Dhabi.

    ReplyDelete


Copyright © 2010 Paul Guenette and Matthew Sleno.