PDA

Click to See Complete Forum and Search --> : [RESOLVED] Deployment and Exception Handling


Bain
May 1st, 2007, 11:37 AM
I have an application which has a "global" exception handler that runs at the very begining of the application (see code below). Everything runs fine in the IDE, however, when I install the application on computers the "global" exception never fires. I am using the VS.NET 2005 Setup Project to create the setup files which are installed on pc's. It would seem that there is some problem with the deployment version of the application, but I dont know for sure.

Any idea's how to fix the problem?



Try
Application.Run(LogInForm)
Catch eData As DataException

MessageBox.Show(eData.Message, "ADO.NET Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

Catch eSql As SqlException

MessageBox.Show(eSql.Message, "SQL Server Error", MessageBoxButtons.OK, MessageBoxIcon.Error)


Catch eSystem As Exception

MessageBox.Show(eSystem.Message, "General System Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

randem
May 1st, 2007, 03:49 PM
If you run the exe run on your development machine does the event fire?

techgnome
May 1st, 2007, 04:53 PM
Make sure you set to "Release" instead of "Debug" when compiling the app before deploying it.

-tg

Bain
May 2nd, 2007, 08:19 AM
I tried to run the .exe on my development machine and it didn't fire.

I also tried setting both the application and deployment configurations to release instead of debug.... still no luck.

Any other suggestions? Are there any other preq's it needs other than the defaults?

Bain
May 2nd, 2007, 12:13 PM
I decided to try a different way to handle the exceptions. I used something similar to what is show at this website (http://www.codeproject.com/dotnet/unhandledexceptions.asp). Seems to be working alright after I deploy the application.

Thanks for the help!