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
{{ message }}
Repository navigation
Removing local variable from method body does not remove it from debug info #674
Editing method body by removing one of the local variables does not update the attached debug information by removing debug info for the local variable. When saved the PDB still has the local variable information in it and some tools get confused (for example PDB2PDB writes out a warning).
I think the correct way to handle this would be to add logic into VariableDefinitionCollection.OnRemove to also remove the variable from the debug info (if it's there) by its index.
I don't think there's anything to do in OnAdd as adding VariableDefinition doesn't carry any information which should be preserved in the debug info (like the name of the variable). So not adding a debug info for the new variable seems to be OK.
Activity