Partilhar via


C# Edit and Continue: error 4017 

Error Message

Renaming a [ namespace | delegate | interface | class | struct | enum | type variable | method | indexer | property | enum member | operator | parameter | field | fixed size buffer | constant | event | using alias | extern alias | attribute ] will prevent the debug session from continuing while Edit and Continue is enabled

This error indicates that you tried to rename an object that cannot be renamed while debugging.

For example, consider the following code:

class Example

{

   static void Main() { }

}

If you step into Main, then try to change Main to Method, this error occurs.

To correct this error

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

    –or–

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

See Also

Reference

delegate (C# Reference)
Interfaces (C# Programming Guide)
class (C# Reference)
struct (C# Reference)
enum (C# Reference)
Methods (C# Programming Guide)
Indexers (C# Programming Guide)
Properties (C# Programming Guide)
operator (C# Reference)
Fixed Size Buffers (C# Programming Guide)
Constants (C# Programming Guide)
event (C# Reference)
using (C# Reference)
extern (C# Reference)
Supported Code Changes (C#)
Edit and Continue (Visual C#)

Concepts

Namespaces (C# Programming Guide)

Other Resources

Edit and Continue Errors and Warnings (C#)