How get a breakpoint on variable write in Visual Studio?

You need to add "Has Changed" condition to your breakpoint. To do this:

  1. Set breakpoint on the line you want it to break when your variable is changed.
  2. Right-click red dot icon, select "Condition".
  3. Enter your variable name and select "Has Changed" option.

You may find more information in this MSDN how-to.


This is referred to as a Data Breakpoint in Visual Studio. To create one you'll need the address of the variable in question (just add &variableName) to the watch or immediate window. Then do the following

  1. Debug -> New Breakpoint -> New Data Breakpoint
  2. Enter the address in and size of the value in bytes

Note: This is only supported for C++ applications. Managed languages don't support data break points.


This is now supported in VS2019 for . NET Core 3.0 or higher check this out

How do I set a data breakpoint?

Setting a data breakpoint is as easy as right-clicking on the property you’re interested in watching inside the watch, autos, or locals window and selecting “Break when value changes” in the context menu. All data breakpoints are displayed in the Breakpoints window. They are also represented by the standard, red breakpoint circle next to the specified property.