Partilhar via


C# Edit and Continue: error 4015 

Error Message

Updating the base class and/or base interface(s) of a [class | struct] will prevent the debug session from continuing while Edit and Continue is enabled

This error indicates that you tried to edit the base class or interfaces of a class or struct, which cannot be changed while debugging.

Consider the following example:

class Example : System.IDisposable

{

   public void Dispose() { }

   static void Main(string[] args) { }

}

If you step into Main, then try to change System.IDisposable to System.IComparable, this error occurs.

To correct this error

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

    –or–

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

See Also

Reference

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

Other Resources

Edit and Continue Errors and Warnings (C#)