Hello,
I have an assembly with a static variable:
private static readonly ILog log4net = LogManager.GetL ogger(typeof(Co re));
In one of the methods, I use this variable:
private void myMethod()
{
...
log4net.Debug(" something to log");
...
}
In one of my NUnit test, I create an instance for this assembly, and
call Mymethod:
Assembly asm = Assembly.LoadFr om("assembly.ex e");
Type typeAssembly = asm.GetType("My Type");
object core = Activator.Creat eInstance(typeA ssembly, true);
typeAssembly.In vokeMember("myM ethod",BindingF lags.InvokeMeth od |
BindingFlags.No nPublic | BindingFlags.In stance, null, core, null);
System.Reflecti on.TargetInvoca tionException : An exception was raised by
the target of a call
----> System.StackOve rflowException : A System.StackOve rflowException
exception was raised at
System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault , Assembly caller, Boolean verifyAccess)
at System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess) at
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, Binding
Flags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture) at System.RuntimeT ype.InvokeMembe r(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifi er[] modifiers, CultureInfo culture, String[]
namedParameters )
Exception not handled : StackOverflowEx ception.
I don't have this error when I don't use the late binding, so log4net is
working (and I can actually the logs on the screen).
Thank you
Julien
I have an assembly with a static variable:
private static readonly ILog log4net = LogManager.GetL ogger(typeof(Co re));
In one of the methods, I use this variable:
private void myMethod()
{
...
log4net.Debug(" something to log");
...
}
In one of my NUnit test, I create an instance for this assembly, and
call Mymethod:
Assembly asm = Assembly.LoadFr om("assembly.ex e");
Type typeAssembly = asm.GetType("My Type");
object core = Activator.Creat eInstance(typeA ssembly, true);
typeAssembly.In vokeMember("myM ethod",BindingF lags.InvokeMeth od |
BindingFlags.No nPublic | BindingFlags.In stance, null, core, null);
System.Reflecti on.TargetInvoca tionException : An exception was raised by
the target of a call
----> System.StackOve rflowException : A System.StackOve rflowException
exception was raised at
System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault , Assembly caller, Boolean verifyAccess)
at System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess) at
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, Binding
Flags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture) at System.RuntimeT ype.InvokeMembe r(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifi er[] modifiers, CultureInfo culture, String[]
namedParameters )
Exception not handled : StackOverflowEx ception.
I don't have this error when I don't use the late binding, so log4net is
working (and I can actually the logs on the screen).
Thank you
Julien
Comment