Solved

exception handling block with console application

Posted on 2009-05-12
6
258 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now