Exception Handling
-
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
-
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
satsumatable wrote:
when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window.
When you're debugging with VS environment then I think it will always notify you with pop-up block when error occurs though you've specified try..catch..
satsumatable wrote:
What is the best way to configure my application to handle all the run time exception?
It's handling Exception itself, for the need it invented.
satsumatable wrote:
Is there any configuration need to be set at Web/Application configuration etc ?
Nothing just use Try..Catch block and Log the error catched by exception handling. That's it.
Regards, Hiren.
My Recent Article: - Way to know which control have raised a postback
My Recent Tip/Trick: - Building Hierarchy using Recursive CTE -
satsumatable wrote:
when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window.
When you're debugging with VS environment then I think it will always notify you with pop-up block when error occurs though you've specified try..catch..
satsumatable wrote:
What is the best way to configure my application to handle all the run time exception?
It's handling Exception itself, for the need it invented.
satsumatable wrote:
Is there any configuration need to be set at Web/Application configuration etc ?
Nothing just use Try..Catch block and Log the error catched by exception handling. That's it.
Regards, Hiren.
My Recent Article: - Way to know which control have raised a postback
My Recent Tip/Trick: - Building Hierarchy using Recursive CTEstatic void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { } Will this resolve ?
-
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { } Will this resolve ?
See THIS[^] article for more detailed information.
Regards, Hiren.
My Recent Article: - Way to know which control have raised a postback
My Recent Tip/Trick: - Building Hierarchy using Recursive CTE -
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
Sounds like you've got first chance exception-handling switched on in Visual Studio. Visual studio normally breaks on an unhandled exception, but you can change a setting so it happens 'first chance' on all exceptions, so even though you've got an exception block (which will still work just fine if you hit F5) it will break there none-the-less. Have a look in your Debug->Exceptions menu.
Regards, Rob Philpott.
-
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
satsumatable wrote:
What is the best way to configure my application to handle all the run time exception?
You can't catch all runtime exceptions. If your application causes a stack overflow, or you run out of memory, the application is terminated immediately without going to the exception handler.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
satsumatable wrote:
have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window
There are three cases that can cause that. 1. Exceptions that cannot be caught. There are three of those, out of memory, stack overflow and an odd ball one that I can't remember and probably has nothing to do with your problem. 2. Exceptions that exits a thread block excluding the specific thread specific ones like interrupt. Any such exception will cause an application exit. The way to prevent this is to insure that all threads have try/catch at the top level. This includes asynchronous methods. And that might be the cause of your problem. 3. Unmanaged code and/or net errors. The second of these would be outside your control. The first means that you are using unmanaged code so presumably you would be aware of that. Also note that AppDomain.UnhandledException will NOT prevent an application exit. All it does is provide a place for you to log what the exception was.
-
Hi, I have C# application with WCF service though I have proper Try.. Catch block in my application very rare when my application crashes or something that sort it didn't get into Catch Block and simply pop-up .Net debug window. What is the best way to configure my application to handle all the run time exception? Is there any configuration need to be set at Web/Application configuration etc ? Thanks
Try Windward Reports. With Windwards Microsoft Word, Excel or PowerPoint can be used as your layout. Windwards Report http://www.windwardreports.com/csharp.htm[^] is very use to use and is super fast.Various different operations can be used quite easily which are difficult with other tools. For more details please go to : http://www.windwardreports.com/csharp.htm[^]