• Hello and welcome to our new forums. We upgraded our forum sites to a more robust and modern system which we hope you will enjoy. Be sure to check out your profile by clicking the button on the top right and configure your preferences, signature, time zone, avatar, etc. as you wish. If you need help with using this new forum'ware try the help link on the bottom right.

    Click here to review your account now.

main exception doesn't work outside IDE

Semola

Member
Joined
Aug 27, 2018
Messages
6
Programming Experience
3-5
Hi All,

I have a problem with a "try catch" code in my program:

In the main module I have inserted this code:

VB.NET:
Try
    Application.EnableVisualStyles()
    Application.VisualStyleState = VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled
    Application.Run(New frmMovieDatabase)
catch ex as exception
    My.Computer.FileSystem.DeleteDirectory(ws_temp_path, FileIO.DeleteDirectoryOption.DeleteAllContents)
    MsgBox(Utility.PadCenter("Si è verificato un errore", 30) & Chr(10) & Chr(13) & Utility.PadCenter("Il programma termina", 30))
    ws_log.ScriviEx(ex)
    ws_log.Dispose()
    System.Environment.Exit(-1)
end try
This code force to quit program immediately if I don't catch an exception in the frmMovieDatabase form and write it in the trace

This code works perfectly in the visual studio IDE, but executing the program outside the IDE (Also like adminstrator), doesn't work.

Did I forget something in the code I indicated?

Anyone can help me?

Thanks

Semola
 
Last edited by a moderator:
Top Bottom