Solved

exception handling block with console application

Posted on 2009-05-12
6
288 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:andieje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24364370
If it does work then it should be fine depending on the application and the deployment scenario. Would it be not easier to use your own exception handling?
0
 

Author Comment

by:andieje
ID: 24364830
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

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24385570.html

any comments are more than welcome

thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24365288
It depends on the size of the application. I have provided many links on that page so you can explore all the options.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:andieje
ID: 24369360
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!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24372125
>but included a screen print of the user's screen
You can modify the code to suit your needs.
0
 

Author Closing Comment

by:andieje
ID: 31580482
thanks
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question