Click here to Skip to main content
15,918,976 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# GDI+ Pin
codebala1-May-06 7:08
codebala1-May-06 7:08 
AnswerRe: C# GDI+ Pin
kasik1-May-06 5:13
kasik1-May-06 5:13 
GeneralRe: C# GDI+ Pin
codebala1-May-06 5:22
codebala1-May-06 5:22 
QuestionDifferent exception handling behavior when running application in standalone mode instead of from visual studio Pin
Dan Neely1-May-06 3:23
Dan Neely1-May-06 3:23 
AnswerRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Drew McGhie1-May-06 4:45
Drew McGhie1-May-06 4:45 
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Dan Neely1-May-06 5:08
Dan Neely1-May-06 5:08 
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
S. Senthil Kumar1-May-06 7:03
S. Senthil Kumar1-May-06 7:03 
AnswerRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Roy Heil1-May-06 7:50
professionalRoy Heil1-May-06 7:50 
Warning: I am guessing here.

Your try is in the Main() function, around the Application.Run. At the application level, there is a global exception handler, which handles exceptions that reach it without being handled in code. When you run the application from the .exe (i.e. not in Visual Studio), the default exception handler is reached without being handle in the application, so you get the unhandled exception dialog. Notice that if you select "continue", the application continues to run, because Application.Run was never exited, and your catch was not used.

Now, when you run your application from Visual Studio, I think that Visual Studio has it's own exception handler (outside the Main() function), and the applications default exception handler is turned off. Thus when you throw your exception, it reaches your catch before it gets to VS's handler. This also explains why the application ends after your MessageBox, because your exception execution to exit the Application.Run.


Roy.
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Dan Neely1-May-06 9:29
Dan Neely1-May-06 9:29 
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Roy Heil1-May-06 18:14
professionalRoy Heil1-May-06 18:14 
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Dan Neely2-May-06 2:55
Dan Neely2-May-06 2:55 
GeneralRe: Different exception handling behavior when running application in standalone mode instead of from visual studio Pin
Dan Neely2-May-06 4:45
Dan Neely2-May-06 4:45 
QuestionHow to create dynamic empty string array Pin
WCup1-May-06 0:38
WCup1-May-06 0:38 
AnswerRe: How to create dynamic empty string array Pin
Larantz1-May-06 0:42
Larantz1-May-06 0:42 
GeneralRe: How to create dynamic empty string array Pin
WCup1-May-06 3:16
WCup1-May-06 3:16 
GeneralRe: How to create dynamic empty string array Pin
codehacker381-May-06 3:46
codehacker381-May-06 3:46 
GeneralRe: How to create dynamic empty string array Pin
Larantz1-May-06 8:21
Larantz1-May-06 8:21 
AnswerRe: How to create dynamic empty string array Pin
Guffa1-May-06 0:45
Guffa1-May-06 0:45 
GeneralRe: How to create dynamic empty string array Pin
code_wiz1-May-06 1:55
code_wiz1-May-06 1:55 
GeneralRe: How to create dynamic empty string array Pin
Guffa1-May-06 2:32
Guffa1-May-06 2:32 
Questionhow to check it programatically Pin
pujareddy1-May-06 0:18
pujareddy1-May-06 0:18 
QuestionKeyboard focus ? Pin
Husam Burhan1-May-06 0:17
Husam Burhan1-May-06 0:17 
AnswerRe: Keyboard focus ? Pin
Ravi Bhavnani1-May-06 2:22
professionalRavi Bhavnani1-May-06 2:22 
QuestionChange Monitor Resolution Pin
freshonlineMax30-Apr-06 23:13
freshonlineMax30-Apr-06 23:13 
AnswerRe: Change Monitor Resolution Pin
CWIZO1-May-06 0:06
CWIZO1-May-06 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.