I have a C# class with a property that uses System.IO.Ports.SerialPort to query data from a device.
When broken into the program with the debugger, evaluating that property first shows
Evaluation of method (...) calls into native method Microsoft.Win32.Win32Native.CreateEvent
(Microsoft.Win32.Win32Native+SECURITY_ATTRIBUTES, bool, bool, string).
Evaluation of native methods in this context is not supported.
and then apparently still tries to execute it, showing
Function evaluation disabled because a previous function evaluation timed out. You must
continue execution to reenable function evaluation.
afterwards and leaves the serial port object in an invalid state.
I can hide the property from being shown when looking at the parent object by setting DebuggerBrowsableAttribute
.
However, moving the mouse over the property name itself still evaluates the property. Is it possible to suppress this as well, or at least let the code detect that it is executing in a debugger context and skip its evaluation?