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.