C# Edit and Continue: error 4024 

Error Message

Deleting a method body will prevent the debug session from continuing while Edit and Continue is enabled

This error indicates that you tried to delete a method, indexer, property, accessor, operators, constructors, destructors, or event, which Edit and Continue does not support while debugging.

Consider the following code:

class Program

{

   static void Main()

   {

   }

}

If you step into Main, then remove the braces ({}) from the method and replace them with a semicolon, this error occurs.

To correct this error

  • Undo the changes, and then continue debugging without the changes.

    —or—

    On the Debug menu, click Stop Debugging, then make the changes, and start a new debugging session.

See Also

Reference

event (C# Reference)
Indexers (C# Programming Guide)
operator (C# Reference)
Destructors (C# Programming Guide)
Supported Code Changes (C#)
Edit and Continue (Visual C#)

Other Resources

Constructors (C# Programming Guide)
Edit and Continue Errors and Warnings (C#)