June 24, 2014

X64 edit and continue

Visual Studio 2013 presents "X64 edit and continue" feature which is much demanding by user in Visual Studio UserVoice site.

Here is how to see it in action:

Consider the following line of code and imagine you are stopped at that line in the debugger (e.g. due to a breakpoint)

int ret = 5 * foo; 

If you try to edit that code and specifically from foo to bar (int ret = 5 * bar;) while debugging in previous versions of Visual Studio, you would see this dialog.

With VS2013, the dialog will not appear again, and instead you’ll be able to edit the code and continue debugging.

For people who are new to the Edit and Continue feature, Edit and Continue eliminates the need to stop and restart a debugging session when a developer makes modification to code being debugged. This feature exist for 32-bit targeted environments and with the latest version of Visual Studio it is now available for 64-bit.

There are several ways that Edit and Continue helps the developer:

  • Rapid development - developers find that starting a debugging session is time consuming making rapid development harder. Having the ability to continue debugging without the need to restart the debugging session makes the scenario much faster.
  • Help fix hard to reproduce bugs - finding the potential location of a bug that is hard to reproduce is extremely difficult. Being able to make changes to the potential area and verifying it simplifies the debugging flow dramatically as it might be difficult to verify the fix done if the debugging session will need to be restarted.
  • Dealing with large scale projects - starting a debugging session for large scale project is time consuming. Adding to its complexity of large projects makes it even more time consuming as any modification to the code, requires in addition to restarting the debugging session time to recompile the project.

Note that some ASP.NET developers are not aware that support for Edit and Continue exists but requires developers to enable it first. This can be done by going to the project properties and under the web settings there is a checkbox you’ll need to check named “enabled Edit and Continue”. To simplify the workflow starting with Visual Studio 2013 the setting is turned on by default.

For Azure cloud tools developers there are two main options: web role and worker role. To enable Edit and Continue for web roles you’ll need to set your web role project to use IIS Express. Worker roles currently are not supported currently.

The additional work, to allow the modification of lambdas and anonymous methods, for example, is something that the team will consider for a future release.