Can I set a breakpoint in a string if in Visual Studio and C #?

Is it possible to set a breakpoint as shown below (an asterisk represents a breakpoint)?

    var x = ifThis ?
*       This() :
        That() ;

The environment is C # and Visual Studio 2015.

(I just told a colleague that I was possible, but seems to have fixed it)

+4
source share
3 answers

You can only place a breakpoint on the entire line.

However, you can:

  • Press F11during debugging to enter a line and see which function has been removed.

  • , ; , , , , VS.

, , → "..."

+6

Visual Studio , . inline if.

!

+6
. VS 2015 , F11.

enter image description here

+1

Source: https://habr.com/ru/post/1617262/


All Articles