?
Solved

exception handling block with console application

Posted on 2009-05-12
6
Medium Priority
?
297 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 2000 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
Independent Software Vendors: 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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