winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Preserve callstack when using Control.BeginInvoke with MethodInvoker

Open elachlan opened this issue 1 month ago • 2 comments

Background and motivation

In an application we have the following code:

Private Sub MyControl_LookUpEdit_EditValueChanged(sender As Object, e As EventArgs) Handles MyControl_LookUpEdit.EditValueChanged
    BeginInvoke(New MethodInvoker(AddressOf AfterMyControlChange))
End Sub

It is used to work around data binding issues where the binding source datasource isn't updated until after the EditValueChanged event (devexpress).

Occasionally we get exceptions. The call stack root is at the function level. So we don't see what triggered the function call.

It would be nice if we could preserve the callstack across the boundary allowing us to fully log it to track down issues.

API Proposal

n/a

API Usage

n/a

Alternative Designs

No response

Risks

No response

Will this feature affect UI controls?

n/a

elachlan avatar Nov 25 '25 23:11 elachlan

I could be wrong on this. It could be an issue with our logging software. I'll investigate that as well.

elachlan avatar Nov 26 '25 00:11 elachlan

@KlausLoeffelmann you should look at this one.

merriemcgaw avatar Dec 02 '25 00:12 merriemcgaw