Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:58:27+00:00 2026-06-06T03:58:27+00:00

I have this code in my application If _oCurrentCall.CustomData.Length > 0 AndAlso UsageType =

  • 0

I have this code in my application

If _oCurrentCall.CustomData.Length > 0 AndAlso UsageType = UsageTypeEnum.Vanlig Then
  RaiseEvent NewIncomingCallWithCustomData(_oCurrentCall)
ElseIf UsageType = UsageTypeEnum.Sentralbord Then
  RaiseEvent NewIncomingCall(_oCurrentCall, Queues)
End If

Without debugging the events are raised just fine and working.
However, when debugging and trying to change execution step like dragging the execution step to the raiseevent in the other condition block, the event doesn’t fire.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:58:28+00:00Added an answer on June 6, 2026 at 3:58 am

    I repro. This is, arguably, a bug in the debugger, it looks very hard to fix to me. It is easier to see when decompiling the code from vb.net to C#. This sample code:

    Class Test
        Public Event Foo As EventHandler
        Public Event Bar As EventHandler
    
        Public Sub Run(ByVal arg As Integer)
            If arg = 0 Then
                RaiseEvent Foo(Me, EventArgs.Empty)
            Else
                RaiseEvent Bar(Me, EventArgs.Empty)
            End If
        End Sub
    End Class
    

    Gets translated to this equivalent C# code:

    public void Run(int arg)
    {
        EventHandler VB$t_ref$S0;
        if (arg == 0)
        {
            VB$t_ref$S0 = this.FooEvent;
            if (VB$t_ref$S0 != null)
            {
                VB$t_ref$S0(this, EventArgs.Empty);
            }
        }
        else
        {
            VB$t_ref$S0 = this.BarEvent;
            if (VB$t_ref$S0 != null)              // <=== HERE!!!
            {
                VB$t_ref$S0(this, EventArgs.Empty);
            }
        }
    }
    

    When you use the Set Next Statement debugger command to set the execution point to the second RaiseEvent statement, the debugger moves the execution point to the statement marked by HERE in the above snippet. Bypassing the initialization of the temporary variable. Which is still null so the event won’t be raised. You can observe this happening by looking at the machine code with Debug + Windows + Disassembly after using the command.

    This is otherwise the exact same kind of event raising code that’s very familiar to any C# programmer, they don’t have the raise event accessor so have to write this:

    var temp = Bar;
    if (temp != null) {
        Bar(this, EventArgs.Empty);
    }
    

    Well, the debugger fumbles this, it is easy to see how it could happen. And how it could have gone on undetected (or ignored) for so long. Workarounds are hard to come by, a statement before the RaiseEvent statement would work but is very impractical. Modifying the variable(s) so that the If statement executes the desired event is possible.

    I reported the issue at connect.microsoft.com, feedback article is here. Don’t expect miracles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in PHP: header(Content-Type: application/vnd.ms-excel); header(Content-Type: application/download); header(Content-Length: .filesize($path.$filename)); header(Content-disposition: attachment;
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
I have this code in my ASP.NET application written in C# that is trying
I have this code to load icon and application name , but it is
I have this controller in Code Igniter application. A value is initialized in the
I have this code in the end of link button click: Response.ContentType = application/zip;
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
For eg, I have this code for my PHP calendar events application. /**MySQL code
In many places in our application we have code like this: using(RAPI rapi =
I have an application with some bunch of code like this: errCode = callMainSystem();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.