Asked by:
Exception Handling error in web.config

Question
-
User-294030300 posted
Hello,
I have the Exception handler defined in my code, and I have this configuration:
<
add name="UI Policy"><
exceptionTypes><
add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None" name="Exception"><
exceptionHandlers><
add logCategory="UI" eventId="100" severity="Error" title="UI Policy Logging" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="UI Policy Logging"/></
exceptionHandlers></
add></
exceptionTypes></
add>But I am getting an error with the <add logCategory="UI" ..> statement. The EL Config Tool says it is fine, but after running it, I get the following error:
The type Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null from configuration could not be created.
Why?
Thursday, August 24, 2006 12:54 PM
All replies
-
User-871919370 posted
Hi,
Did you solve your issue? or did u give up on it :)
I'm having a similar problem
Thank you for your help!
Tuesday, August 29, 2006 3:41 PM -
User-294030300 posted
Hey,
Gave up so far... I don't have the time... I could easily create my own custom component to do this... All you need is a class with a static method to write, and do a database write like any other DAC object.
Tuesday, August 29, 2006 7:44 PM -
User1954573110 posted
Hi there,
I had the same problem.
It has to do with the instantiation of the class, so it must be a problem of a DLL, I figured.
So in a brute force atempt, i added references to all the DLLs in the instalation dir\bin of the Ent Lib (in my case it is C:\Program Files\Microsoft Enterprise Library January 2006\bin) to the project, and now it runs smoothly.
I will try to figure the exact class(es) and when I do, I'll add a new message here.
Hope it helps!
Rui
Monday, October 2, 2006 10:42 AM -
User183989170 posted
Any luck on this? I'm having the same issue.
Rick
Thursday, October 5, 2006 7:45 PM -
User1902895170 posted
I found that the solution to the problem was that you need 2 references. The documentation for the PuzzlerUI lab only mentions that you need a reference to the exception handling DLL. You must also add a reference to the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging as well to avoid the unhandled exception.
Monday, October 9, 2006 12:42 PM -
User-349411536 posted
I had the same problem and I resolved it by first referencing the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging; and then using the namespace in the necessary page.
For any clarification get back to me...
Regards,
Jai
Monday, December 4, 2006 6:47 AM -
User1747297104 posted
Same problem here, I tried all of the above things, but they dind't worked for me.
What did worked is very strange, I create a LoggingExceptionHandler, but don't use it.
I'm guessing that it forces the loading of the DLL and therefore it works. If I comment out the line: LoggingExceptionHandler han=null; it gives me the error that was mentioned in the first post.
using Microsoft.Practices.EnterpriseLibrary.Logging;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
namespace VLM.ImportFarmers.Common.ExceptionHandling
{
public class ExceptionManager
{
public static void HandleExceptionNoLogging(Exception Ex)
{
LoggingExceptionHandler han=null;
ExceptionPolicy.HandleException(Ex, "Global Policy");
}It's not a clean way, but creating an empty LoggingExceptionHandler hasn't got a huge impact and it works...
Monday, January 8, 2007 9:44 AM -
User1217114082 posted
Thanks ..I too faced the same probs It works[:)]
Wednesday, June 27, 2007 5:52 PM -
User189198308 posted
Hi Guys,
I had the same problem. I added to my references
Microsoft.Practices.EnterpriseLibrary.Logging; Microsoft.Practices.EnterpriseLibrary.Common; Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.Design,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design and
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging
and it worked like a charm.
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Wednesday, August 15, 2007 12:07 PM -
User-681585035 posted
me too got the same problem
by including
Microsoft.Practices.EnterpriseLibrary.Logging Microsoft.Practices.EnterpriseLibrary.Common,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.Design,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design,
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging,
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,
and Microsoft.Practices.ObjectBuilder.dll
I was solved
Friday, November 30, 2007 6:31 AM -
User-586899911 posted
Well I did have the same problem. The following dll need to be referenced which resolves this problem.
Microsoft.Practices.EnterpriseLibrary.Logging
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging
Microsoft.Practices.EnterpriseLibrary.LoggingMonday, April 14, 2008 9:58 AM