You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated ToString() method of a message affects the state of the message.
Since the debugger calls to ToString() to show its data in the watches, it messes up with the state of the program.
Your ToString() override should have no observable side effects to avoid complications in debugging. For example, a call to the ToString() method should not change the value of instance fields.
The text was updated successfully, but these errors were encountered:
The generated ToString() method of a message affects the state of the message.
Since the debugger calls to ToString() to show its data in the watches, it messes up with the state of the program.
Moreover, quoting from the
ToString()
documents "Notes to Inheritors": https://learn.microsoft.com/en-us/dotnet/api/system.object.tostringToString()
override should have no observable side effects to avoid complications in debugging. For example, a call to theToString()
method should not change the value of instance fields.The text was updated successfully, but these errors were encountered: