System.Reflection.MethodBase.GetCurrentMethod() isn't from the log4net assembly 
so this isn't a log4net error.

What is your code trying to do? The usage for logging exceptions is usually:

 log.Error(ex)

where the current Type has already been used to create the ILog instance.

This works for me:

 try
 {
     throw new Exception();
 }
 catch (Exception ex)
 {
     string type = 
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString();
     Console.WriteLine(type);
 }

----- Original Message ----
From: aus1977 <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, March 27, 2008 11:47:39 AM
Subject: System.Reflection.MethodBase.GetCurrentMethod ()' threw an exception 
of type 'System.ArSystem.Reflection.MethodBase


I am trying to use log4net in next manner :
LogException(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(),ex)

and i am getting System.Reflection.MethodBase.GetCurrentMethod ()' threw an
exception of type 'System.ArSystem.Reflection.MethodBase somebody help me .
-- 
View this message in context: 
http://www.nabble.com/System.Reflection.MethodBase.GetCurrentMethod-%28%29%27-threw-an-exception-of-type-%27System.ArSystem.Reflection.MethodBase-tp16326610p16326610.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




Reply via email to