Logging exceptions in C# ASP.NET -
i have been doing revision regarding asp.net mvc applications upcoming exam , found following question:
you maintain asp.net mvc applicaton. errors logged trace object. applicaton contains following code. line numbers included reference only:
the load method throws exception. each of following statements, select yes if statement true. otherwise, select no.
all of answers written are: yes, no, yes respectively. however, not make sense me. answers correct?
this order interpreting answer placing events.
1) number of exceptions incremented.
2) view rendered.
when exception logged?
according answer 2, since marked false - after view rendered
according answer 3, before number of exceptions incremented
any above contradiction appreciated. thanks
according documentation
the firstchanceexception event of appdomain class lets receive notification exception has been thrown, before common language runtime has begun searching exception handlers.
which suggests #1 true #2 true #3 false correct answers.
one scenario fits answers you've been given implies logging file , have not set trace.autoflush = true or used trace.flush(), in case wouldn't seen exception on file before view rendered or variable incremented. question per se not imply of that.
Comments
Post a Comment