Search code examples
.netvb.netdebuggingvisual-studio-2012conditional-breakpoint

Conditional Breakpoints in Visual Studio 2012


In a relatively large VB.NET application, I have the following code.

code

The code sits within a for loop that runs for every given service object. I want a conditional break point that will only activate when objService.VehLastMile is Nothing.

So I right-click my break point and add a condition, here it is:

condition

But this does not work! my break point is not hit! what am I doing wrong?

Any help would be great.

Thank You.


Solution

  • The = operator doesn't work for a value of nothing in VB.NET

    You should either use the Is operator:

    objService.VehLastMile Is Nothing
    

    Or IsNothing function:

    IsNothing(objService.VehLastMile)