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](IEnumerable
1 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__d
2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable
1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Ninject.Activation.Providers.StandardProvider.Create(IContext context) at Ninject.Activation.Context.Resolve()
2.MoveNext() at System.Linq.Enumerable.d__b0
at Ninject.KernelBase.<Resolve>b__7(IContext context) at System.Linq.Enumerable.<SelectIterator>d__d1.MoveNext() at System.Linq.Enumerable.Single[TSource](IEnumerable
1 source) at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters)