locked
VB$AnonymousDelegate RRS feed

  • Question

  • Hello,

    Since the last update to my software, I see a new node in the IL DASM as shown below:

    This did not exist before, what caused this to appear? Thanks in advance :)

    Friday, October 9, 2020 10:01 PM

All replies

  • That is an internal naming convention used by the engineers at Microsoft, there are others that have a tilde too.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, October 10, 2020 12:07 AM
  • Hey, thanks for the tip.

    Is it because before I used:

    If Label.InvokeRequired Then
      Dim d As New SetText1Callback(AddressOf SetText1)
      Invoke(d, New Object() {Message})

    But now I use:

    If Label.InvokeRequired Then
      Invoke(Sub() Label.Text = Message)

    And generally what's the difference between method 1 & 2 above?

    Saturday, October 10, 2020 1:49 PM
  • Hey, thanks for the tip.

    Is it because before I used:

    If Label.InvokeRequired Then
      Dim d As New SetText1Callback(AddressOf SetText1)
      Invoke(d, New Object() {Message})

    But now I use:

    If Label.InvokeRequired Then
      Invoke(Sub() Label.Text = Message)

    And generally what's the difference between method 1 & 2 above?

    Don't know with incomplete code e.g. SetText1Callback and SetText1 ???

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, October 10, 2020 2:05 PM
  • old code is commented:

    Private Delegate Sub SetText1Callback(ByVal Message As String)
    Private Sub SetText1(ByVal Message As String)
        If Label.InvokeRequired Then
            'Dim d As New SetText1Callback(AddressOf SetText1)
            'Invoke(d, New Object() {Message})
            Invoke(Sub() Label.Text = Message)
        Else
            Label.Text = Message
        End If
    End Sub

    Saturday, October 10, 2020 2:25 PM
  • Hi OSVBNET,

    Thanks for your feedback.

    In general, 'VB$AnonymousDelegate_0' is related to the CIL code generated from anonymous method.

    Check the following reference.

    Generating IL for Anonymous Methods 

    Though the code is C#, it is also applicable to VB.NET.

    Hope it could be helpful.

    Best Regards,

    Xingyu Zhao

     

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, October 12, 2020 2:21 AM
  • Hi OSVBNET,

    How is the question going? If your question has been answered then please click the "Mark as Answer" Link at the bottom of the correct post(s), so that it will help other members to find the solution quickly if they face a similar issue.

    Besides, if you need further assistance, please let me know. 

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, October 21, 2020 2:25 AM