Share via


C# Edit and Continue: error 4066 

Error Message

Updating the 'this' or 'base' call of a constructor will prevent the debug session from continuing while Edit and Continue is enabled

This error occurs when you have a base or this call after the constructor declaration. Consider the following example:

class Program

{

   public Program()

      : this(10)

   {

   }

   public Program(int a) { }

   static void Main()

   {

   }

}

If you step into the application, then try to change this(10) to this(20), error 4066 occurs.

To correct this error

  • On the Edit menu, click Undo 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

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

Other Resources

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