c# - Exception not caught using catch block -


this question has answer here:

last week had question, there exception not being caught using below catch block, please confirm..

try {   //code block here } catch(exception ex) {  } 

question: exception can caught using exception base class except 1 exception exception?

stackoverflowexception not caught because indicates condition not recoverable, in more recent versions of .net framework.

http://msdn.microsoft.com/en-us/library/system.stackoverflowexception(v=vs.110).aspx

from documentation

version considerations in prior versions of .net framework, application catch stackoverflowexception object (for example, recover unbounded recursion). however, practice discouraged because significant additional code required reliably catch stack overflow exception , continue program execution. starting .net framework version 2.0, stackoverflowexception object cannot caught try-catch block , corresponding process terminated default. consequently, users advised write code detect , prevent stack overflow. example, if application depends on recursion, use counter or state condition terminate recursive loop. note application hosts common language runtime (clr) can specify clr unload application domain stack overflow exception occurs , let corresponding process continue. more information, see iclrpolicymanager interface , hosting overview.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -