In visual studio, how do you break the debugger when a property changes that you don’t speak a managed language (e.g. C #),

I have a strange situation when something sets the TopMost property of the main MDI form to true. After much trial and error, we are sure that this should come from a third-party library, but this is not in the places we would expect.

It would be very easy to fix this if we could just install the break application in the debugger whenever this property was set. However, this property is determined by the WinForms libraries, so we cannot just put a breakpoint there.

In cases where you are working with a library for which you do not have source code, this would be invaluable, but I am afraid that there is no solution to this problem, since data access points are not supported for managed languages ​​(as far as possible I know).

So, in C #, is there a way you know to break when a property changes, when you don’t have access to the breakpoint in the setter? This can easily solve many problems with edge problems when the situation changes for reasons that you cannot expect.

+4
source share
1 answer

, . TopMost , , , .

" " Visual Studio (Debug → Windows → Breakpoints), "New → Function Breakpoint", :

System.Windows.Forms.Form.set_TopMost

(, ) .

, , " " . → → → " ".

+8

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


All Articles