Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

exception handling block with console application

Hi

I am using vb.net 2005 and writing a console application. I thought I would look at using enterprise library 2.0 to handle and log my exceptions. The EHB requires a config file for the application to configure the exception policies and the like but I didn't think console applications had config files. I'm not a programmer by trade so I am probably wrong and way behind the times. I created a new console application and saw that I can add an app.config file. Before I go any further I just wanted to check it is ok to use add and app.config file to a console application and in turn use the EHB.

Many thanjks
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andieje
andieje

ASKER

I don't know if it would be better to use my own exception handling. I was assuming the enterprise library would help me to use best practices and things like that. I did ask a question about exception handling and teh best way to do it in my console application here. This question also shows the way exceptions are currently handlied in the application

https://www.experts-exchange.com/questions/24385570/vb-net-2005-error-logging-in-a-console-application.html

any comments are more than welcome

thanks
It depends on the size of the application. I have provided many links on that page so you can explore all the options.
Avatar of andieje

ASKER

Hi

I looked at those links and didn't really think any of them were suitable. Many of them were for a global exception handler and I wasn't really looking for that. One of them did email you the errors but included a screen print of the user's screen which I think is illegal so that wasn't any use either. As you can see from this question I have been looking at using the exception handling feature of the enterprise library as this can automatically log your errors to database or email or file or application log. This is more along the lines of what I wanted. I just haven't been able to get the thing to work. Well only just!
>but included a screen print of the user's screen
You can modify the code to suit your needs.
Avatar of andieje

ASKER

thanks