Exception Handling (Place to which project?)

Topics: Exception Handling Application Block, General discussion, Logging Application Block
Apr 29, 2008 at 8:53 AM
Hi All

If I have a solution, which contains three projects. One is Web project, one is DAL project and one is business project.

Where should I place the exception handling application block if I want to log the event log to event viewer?

Regards
Alex
Apr 29, 2008 at 2:23 PM
If you are referencing your DAL and business projects in your Web Project, then your exception handling block would go in your web.config file.

Apr 29, 2008 at 4:00 PM


NeoAdroit wrote:
If you are referencing your DAL and business projects in your Web Project, then your exception handling block would go in your web.config file.




But if I have a solution and the DAL is not under the same Web Project? Where should I put the excpetion handling block? Still the web.config under Web Project?
Apr 30, 2008 at 9:54 PM
Yes. Though DAL is not under the same web project, you still add a reference to DAL in your web project isnt it? So, when your web projects calls in to DAL, it is your web.config that holds the application configuration.

The point is your block configuration can only be in your applications configuration file, be it app.config or web.config. Now for some reasons, if you would like to have separate configuration file for each block for maintenance reasons, you would use file configuration sources, but still there will be hooks to these files, in your application configuration file.