I was creating some complex applications in Visual Basic .NET 2008 and since they are in the testing phase right now, people manage to find an error or two every so often that causes the program to crash. The problem is that there is a tracking piece to it that logs who is currently using the programs. When a user logs in, it logs that they are currently logged in, and if the form close event is fired, the log is deleted to show that they have closed it.
Now my problem comes whenever the form crashes from an error since it won’t trigger the close event and therefore makes the log become inaccurate. My question is if it is possible to capture any error that the form would have in the form of an event?
Try double-clicking on “My Project” in the Solution Explorer.
On the “Application” tab, toward the bottom is a “View Application Events” button. Click it.
You should see an “ApplicationEvents” file. Select the
UnhandledExceptionevent.It should look like this:
Note: this event will not fire while a debugger is attached.