Ninject 2 for CF3.5 TargetInvocationException

Posted by jack london on Stack Overflow See other posts from Stack Overflow or by jack london
Published on 2010-03-24T16:22:55Z Indexed on 2010/03/24 16:23 UTC
Read the original article Hit count: 872

Filed under:
|
|

In middle of application when calling following line:

var component = _Kernel.Get<IComponent>();

I'm getting TargetInvocationException. IComponent is a Form.

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.ConstructorInfo.Invoke(Object[] parameters) at Ninject.Injection.ReflectionInjectorFactory.<>c_DisplayClass1.b_0(Object[] args) at Ninject.Activation.Providers.StandardProvider.Create(IContext context) at Ninject.Activation.Context.Resolve()
at Ninject.KernelBase.b_7(IContext context) at System.Linq.Enumerable.d_d2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at Ninject.Planning.Targets.Target1.ResolveWithin(IContext parent) at Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target) at Ninject.Activation.Providers.StandardProvider.<>c__DisplayClass2.<Create>b__1(ITarget target) at System.Linq.Enumerable.<SelectIterator>d__d2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Ninject.Activation.Providers.StandardProvider.Create(IContext context) at Ninject.Activation.Context.Resolve()
at Ninject.KernelBase.<Resolve>b__7(IContext context) at System.Linq.Enumerable.<SelectIterator>d__d
2.MoveNext() at System.Linq.Enumerable.d__b01.MoveNext() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source) at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters)

© Stack Overflow or respective owner

Related posts about ninject

Related posts about cf