application has generated an exception that could not be handled

R

rs

Hi guys

Thank you in advance for the help. I developed a simple application
using vs.net 2003. running framework 1.1 sp1. the application runs fine
on the development machine (win xp). I tried to deploy it on a win 2000
sp4 framework 1.1 sp1. I got the following error

Reminder.exe - Common Language Runtime Debugging Services

application has generated an exception that could not be handled

process id = 0x530(1328), thread id 0x4ac(1196)

I have other .net application works fine on the same machine and they
where developed on the same xp machine as well.

the reminder program is basically a form with a 3D style label that
stays always on topm, topmost property enabled. It also that two
timers. one to have the color for the text switches from black red and
the other time to switch texts. I have 4 menu items, first one opens a
font dialog, senond one allows customizing the text, thrid item is to
switch always on top to not always on top. the last one opens an about
form. I am not using a main function. what I will try next is to have a
main function with try/catch blocks. I tried the full permission in the
..net configuaration. nogood.

any other suggestes??

Thanks
 
J

Jay B. Harlow [MVP - Outlook]

rs,
In addition to the other comments.

Depending on the type of application you are creating, .NET has three
different global exception handlers.

For ASP.NET look at:
System.Web.HttpApplication.Error event
Normally placed in your Global.asax file.

For console applications look at:
System.AppDomain.UnhandledException event
Use AddHandler in your Sub Main.

For Windows Forms look at:
System.Windows.Forms.Application.ThreadException event
Use AddHandler in your Sub Main.

It can be beneficial to combine the above global handlers in your app, as
well as wrap your Sub Main in a try catch itself.

There is an article in the June 2004 MSDN Magazine that shows how to
implement the global exception handling in .NET that explains why & when you
use multiple of the above handlers...

http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx

For example: In my Windows Forms apps I would have a handler attached to the
Application.ThreadException event, plus a Try/Catch in my Main. The
Try/Catch in Main only catches exceptions if the constructor of the MainForm
raises an exception, the Application.ThreadException handler will catch all
uncaught exceptions from any form/control event handlers.

Some useful articles on Exception handling:

http://www.codeproject.com/script/articles/list_articles.asp?userid=450027

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/exceptdotnet.asp


Hope this helps
Jay
 
R

rs

Thanks for the input guys. I will try these suggestions when I get to
my machine. I will keep you updated.

Thanks again

Ahmed
 
R

rs

its really funny. I knew where the problem came from.
I had autoscale checked for the dynamic properties which added another file
called Reminder.exe webconfiguration file. i noticed that if i am dont have
that file in the same directory as my main reminder.exe i will get that
error.

Thanks guys for your input

Ahmed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top