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?
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
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.
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
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.
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.
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.
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...
bmains
All-Star
29116 Points
5886 Posts
MVP
Exception Handling error in web.config
Aug 24, 2006 04:54 PM|LINK
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?
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
mamoonseth
Member
5 Points
1 Post
Re: Exception Handling error in web.config
Aug 29, 2006 07:41 PM|LINK
Hi,
Did you solve your issue? or did u give up on it :)
I'm having a similar problem
Thank you for your help!
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Exception Handling error in web.config
Aug 29, 2006 11:44 PM|LINK
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.
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
ruimelo
Member
5 Points
1 Post
Re: Exception Handling error in web.config
Oct 02, 2006 02:42 PM|LINK
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
rboarman
Member
64 Points
23 Posts
Re: Exception Handling error in web.config
Oct 05, 2006 11:45 PM|LINK
Any luck on this? I'm having the same issue.
Rick
kgayda
Member
10 Points
2 Posts
Re: Exception Handling error in web.config
Oct 09, 2006 04:42 PM|LINK
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.
jbanx
Member
10 Points
2 Posts
Re: Exception Handling error in web.config
Dec 04, 2006 10:47 AM|LINK
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
TheRave
Member
4 Points
2 Posts
Re: Exception Handling error in web.config
Jan 08, 2007 01:44 PM|LINK
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...
ennganesh
Member
2 Points
1 Post
Re: Exception Handling error in web.config
Jun 27, 2007 09:52 PM|LINK
Thanks ..I too faced the same probs It works[:)]
mosius
Member
77 Points
27 Posts
Re: Exception Handling error in web.config
Aug 15, 2007 04:07 PM|LINK
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