Yair Halberstadt
Yair Halberstadt

Reputation: 6821

Set value of a private list in visual studio debugger

In visual studio you can edit the value of some fields in the locals window or by hovering over them:

enter image description here

However this doesn't work for replacing a list which is a private field (in this case when I write click on _sectionList the Edit value option is greyed out).

Is there anyway to set the value of a private list field in the visual studio debugger?

In particular I want to replace _sectionList with sectionList2.

Upvotes: 4

Views: 738

Answers (2)

Thomas Ayoub
Thomas Ayoub

Reputation: 29431

You can use the Immediate Window (CtrlAltI) to assign whatever you want to your private fields.

Upvotes: 4

Biesi
Biesi

Reputation: 910

You can use the Watch 1 tab and let it evaluate the expression sectionManipulator._sectionList = sectionList2.

Upvotes: 3

Related Questions