Enterprise Library 3.1 Log Errors

Technorati Tags:

Today, I came across a couple of confusing errors while trying to re-setup logging again on a new PC and running my web application.  It was throwing an exception logging error for Enterprise Library in my Data Layer.

Error 1:

“Format of the initialization string does not conform to specification starting at index 45”

This is a pretty common error that simply pertains to an incorrect DB connection in your config file (web.config, etc.)

The problem on my end was that I had setup the DB connection string quite a while back for the web app using the Enterprise Library Config Tool.  Recently I copied over the code to a brand new machine and when trying to run this app, obviously, the connection string was no longer valid but I did not see that until I got this error in my EL exception handling code.

Error 2:

“Inaccessible logs: Security Error”

After fiddling around with the exception and logging blocks in the Enterprise Library Config tool a bit, I was not able to get the error to go away.  However what I do think fixed it was ultimately closing out VS 2008 and re-opening VS 2008 in Administrator mode on my Vista machine and as soon as I did that and re-built the website, that error went away.

Here’s the example code where it was throwing the error:

   1: catch (Exception ex)
   2: {
   3:     if (ExceptionPolicy.HandleException(ex, "Elbalazo.DataLayer.Exceptions"))
   4:     {
   5:         throw;
   6:     }
   7: }

   kick it on DotNetKicks.com

Print | posted on Monday, September 29, 2008 2:02 AM

Comments on this post

# re: Enterprise Library 3.1 Log Errors

Requesting Gravatar...
Yeah I love enterprise library and what it has to offer. My experience with logging is mixed because it fails gracefully (or ninja style). You never know that it's not working until you look for the log file; though I love how easy it is to implement.
Left by Khalid on Sep 29, 2008 1:28 PM

Your comment:

 (will show your gravatar)
 
Please add 6 and 8 and type the answer here: