Share via

Need Help with Next Debugging Step

RogerSchlueter-7899 1,736 Reputation points
2026-06-20T03:24:06+00:00

The issues arises with a VB/wpf application. The picture below shows where my application is halted at a breakpoint and the arrow shows the next step:

Breakpoint

That next stop is just the End Sub. But when I execute that step the application halts and disappears completely although Visual Studio remains undisturbed. There is no error message, there is nothing in the debug window, there is nothing more in the Call Stack and no exception is thrown. I can find no additional info in the other debug windows.

So, what can I do to chase down the problem?

Developer technologies | Visual Studio | Debugging

2 answers

Sort by: Most helpful
  1. Senthil kumar 1,120 Reputation points
    2026-06-20T05:29:40.76+00:00

    Hi @RogerSchlueter-7899

    I understand your issue. you want know what will be return in cvsSites.

    Just check cvsSites having sub properties like count(cvsSites.Count) or hasError like that. below give some example.

    If cvsSites.Count > 0 Then
    
    End If
    

    if you set like that breakpoint come to the IF section you will find it. what returned in cvsSites.

    Thanks.

    Was this answer helpful?

    3 people found this answer helpful.

  2. Nancy Vo (WICLOUD CORPORATION) 6,590 Reputation points Microsoft External Staff Moderator
    2026-06-22T06:21:30.8266667+00:00

    Hello @RogerSchlueter-7899 ,

    Thanks for your question.

    WPF starts reading those 89 items to generate the visual UI in the background. If there is a binding error, a bad data format in one of the properties, or a threading issue during that render, WPF will suffer a fatal crash after your End Sub completes. Because this happens deep in the presentation framework, Visual Studio sometimes misses it with default settings, and the app terminates silently.

    I recommend some following steps:

    1. Force Visual Studio to break on all exceptions.

    By default, Visual Studio might continue past certain background exceptions. You can force the debugger to halt the exact millisecond the crash happens.

    • Go to Debug > Windows > Exception Settings in your top menu.
    • Check the box next to Common Language Runtime Exceptions.
    • Run the app again to see if it stops and highlights the internal error.
    1. If Visual Studio still doesn't catch the crash, the Windows operating system definitely recorded it.
    • Open the Event Viewer app on your Windows PC.
    • Navigate to Windows Logs > Application.
    • Look for a red error or .NET runtime error at the exact timestamp your app closed. The details pane will usually contain the exact exception message.
    1. WPF provides a built-in safety net for catching errors that happen on the main UI thread. You can add a DispatcherUnhandledException handler in your App.xaml.vb file to catch these silent crashes and display them in a message box before the app closes.

    I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.