Partager via


C# Edit and Continue: error 4016 

Error Message

Updating the kind of a [structs | interface | enum | class] will prevent the debug session from continuing while Edit and Continue is enabled.

This error indicates that you tried to edit the kind of a type that cannot be changed while debugging. You tried to change a structure, interface, enumeration, or class to another type, for example, a structure to a class.

Consider the following example:

class Example

{

   static void Main(string[] args) {}

}

If you step into Main, then try to change class to struct, 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, and then start a new debugging session.

See Also

Reference

class (C# Reference)
struct (C# Reference)
Interfaces (C# Programming Guide)
enum (C# Reference)
Supported Code Changes (C#)
Edit and Continue (Visual C#)

Other Resources

Edit and Continue Errors and Warnings (C#)