Visual basic project exits after 15 seconds without invoking any form_event

Danny Bosschaerts 21 Reputation points

A perfectly running project on my previous PC in Microsoft Visual Studio Community 2022 (64-bit) Version 17.0.4, now loads and compiles without any issues, and runs and functions perfectly, but after about 15 seconds it just stops, as if one would hit the 'stop' button in the IDE.
Identical to the behaviour of the 'stop' button in the IDE, no form_events (unload, closing, ...) is invoked.

Is there a simple solution for this, or how/where to capture any logging that would hint me to the reason of this behaviour.
In the application and/or event_logs is nothing that helps me, but maybe some additional triggers should be configurated somewhere.


An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,607 questions
{count} votes

Accepted answer
  1. Leon Stanley 96 Reputation points

    If you see no activity in the process window, then the program is not running at all. You are freezing VS.
    Make sure you have all components loaded for VS.
    In VS choose Tools >> Get Tools and Features.
    Under the Workloads tab >> Desktop and Mobile (5)
    you should need both [Net desktop developments] AND [Universal Windows Platform development] ticked.
    If not you need to select them and download the missing components.

6 additional answers

Sort by: Most helpful
  1. LesHay 7,126 Reputation points

    Just a guess. Maybe a Try...Catch block somewhere has some exception causing code in it making it loop and finally overflowing?
    Maybe single stepping from strategically placed break points could help finding the cause?

    0 comments No comments

  2. Danny Bosschaerts 21 Reputation points

    Hi, and thanks.

    I tried all that. As I said: this project ran perfectly on my previous PC.
    I didn't see CPU time nor memory useage creeping up.

    I would expect that one would see at least something in the output or debug windows, but nothing.

    0 comments No comments

  3. LesHay 7,126 Reputation points

    Well, not much to go on. I hsve never experienced it myself and so maybe someone else can offer some things to check.

    0 comments No comments

  4. RLWA32 41,046 Reputation points

    Here's an example of the logging provided when using the capabilities described at Monitoring Silent Process Exit.

    A VB Winform application (VBVictim) with event handlers for FormClosing and FormClosed is killed by another process that sets the exit code to 0.

    Before VBVictim termination -

    After VBVictim termination -

    Application Event log entry -

    0 comments No comments