Partilhar via


C# Edit and Continue: error 4013 

Error Message

Updating the size of a fixed field will prevent the debug session from continuing while Edit and Continue is enabled

This error indicates that you tried to edit the size of a fixed-size buffer, which cannot be changed while debugging.

For example, consider the following code:

unsafe struct Example

{

   fixed int buffer[20];

}

class Program

{

   static void Main() { }

}

If you step into Main, then try to change buffer(20) to buffer(10), this error occurs.

To correct this error

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

See Also

Reference

Fixed Size Buffers (C# Programming Guide)
Supported Code Changes (C#)
Edit and Continue (Visual C#)

Other Resources

Edit and Continue Errors and Warnings (C#)