Partilhar via


C# Edit and Continue: error 4020 

Error Message

Moving a [type | member | parameter | constraint | using] will prevent the debug session from continuing while Edit and Continue is enabled

This error indicates that you tried to move a type, member, parameter, constraint, or using statement; which Edit and Continue does not support while debugging.

For example, consider the following code:

class Example

{

   int pooh;

   int bear;

   static void Main() { }

}

If you step into Main, then try to cut bear and paste it above the pooh declaration, an error occurs.

To correct this error

  • Choose Undo from the Debug menu to undo the changes.

    –or–

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

See Also

Reference

using (C# Reference)
Supported Code Changes (C#)
Edit and Continue (Visual C#)

Other Resources

Types (C# Reference)
Edit and Continue Errors and Warnings (C#)