"Error loading Ninject component IEnumerable{IActivationStrategy}
No such component has been registered in the kernel's component
container."
exception.
This is with the new Ninject 2.0 official release, using the
Silverlight 3 binaries.
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ninject?hl=en.
Suggestions:
1) If you have created a custom subclass for KernelBase, ensure that
you have properly
implemented the AddComponents() method.
2) Ensure that you have not removed the component from the container
via a call to RemoveAll().
3) Ensure you have not accidentally created more than one kernel.
StackTrace:
at Ninject.Components.ComponentContainer.Get(Type component)
at
Ninject.Components.ComponentContainer.<CreateNewInstance>b__6(ParameterInfo
parameter)
at System.Linq.Enumerable.<SelectIterator>d__d`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1
source)
at Ninject.Components.ComponentContainer.CreateNewInstance(Type
component, Type implementation)
at Ninject.Components.ComponentContainer.ResolveInstance(Type
component, Type implementation)
at Ninject.Components.ComponentContainer.Get(Type component)
at
Ninject.Components.ComponentContainer.<CreateNewInstance>b__6(ParameterInfo
parameter)
at System.Linq.Enumerable.<SelectIterator>d__d`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1
source)
at Ninject.Components.ComponentContainer.CreateNewInstance(Type
component, Type implementation)
at Ninject.Components.ComponentContainer.ResolveInstance(Type
component, Type implementation)
at Ninject.Components.ComponentContainer.Get(Type component)
at Ninject.Components.ComponentContainer.Get[T]()
at Ninject.KernelBase.CreateContext(IRequest request, IBinding
binding)
at Ninject.KernelBase.<>c__DisplayClass7.<Resolve>b__3(IBinding
binding)
at System.Linq.Enumerable.<SelectIterator>d__d`2.MoveNext()
at System.Linq.Enumerable.<SelectIterator>d__d`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b0`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1
source)
at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root,
IParameter[] parameters)
at
InputEmulator.WindowsPhone7Series.InputHandlers.BindMouseControlsScreen(IKernel
kernel)
at
InputEmulator.WindowsPhone7Series.InputHandlers.BindInputHandlers(IKernel
kernel)
at
InputEmulator.WindowsPhone7Series.KernelFactory.get_Current()
at
InputEmulator.WindowsPhone7Series.App.Application_Startup(Object
sender, StartupEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32
typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr
unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
On Mar 17, 10:28 pm, Ian Davis <ida...@innovatian.com> wrote:
> Can you post the full exception please?
>
>
>
> On Wed, Mar 17, 2010 at 10:26 PM, aemami <aemam...@gmail.com> wrote:
> > So far it doesn't seem to work - I keep getting a
>
> > "Error loading Ninject component IEnumerable{IActivationStrategy}
> > No such component has been registered in the kernel's component
> > container."
>
> > exception.
>
> > This is with the new Ninject 2.0 official release, using the
> > Silverlight 3 binaries.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ninject" group.
> > To post to this group, send email to nin...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ninject+u...@googlegroups.com<ninject%2Bunsu...@googlegroups.com >
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
1. Yes.
2. Yes.
3. Not sure what you mean by changing the binding... if you mean am
I calling kernel.Bind<ISomething>().To<Something>() then yes.
4. No.
> > <ninject%2Bunsu...@googlegroups.com<ninject%252Bunsubscribe@googlegroup s.com>>
> > <ninject%2Bunsu...@googlegroups.com<ninject%252Bunsubscribe@googlegroup s.com>>
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
I am not doing any of those things you mentioned.
It must be that Ninject is relying on something that is part of the
normal .NET frameworks but that does not exist on the WP7 framework
(which so far is a stripped-down version of Silverlight 3).
> > > > <ninject%2Bunsu...@googlegroups.com<ninject%252Bunsubscribe@googlegroup s.com>
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
I'd say you should be able to reproduce the problem pretty quickly
using the Windows Phone SDK available here:
http://developer.windowsphone.com/windows-phone-7-series/
--
Thanks for taking the time to investigate. One remark: the current WP7
SDK - actually the emulator - won't run in a virtualized environment -
if you tried that.
> > ninject+u...@googlegroups.com<ninject%2Bunsu...@googlegroups.com >
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
> > <ninject%2Bunsu...@googlegroups.com<ninject%252Bunsubscribe@googlegroup s.com>>
Btw is there anything I can do to help with fixing the problem?
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
On Mar 28, 9:44 pm, Ian Davis <ida...@innovatian.com> wrote:
> Can you figure out what is causing the bug ;)
>
>
>
> On Sun, Mar 28, 2010 at 11:35 AM, oliverw <mmo...@googlemail.com> wrote:
> > Btw is there anything I can do to help with fixing the problem?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ninject" group.
> > To post to this group, send email to nin...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ninject+u...@googlegroups.com<ninject%2Bunsu...@googlegroups.com >
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
On Mar 29, 5:25 am, Ian Davis <ida...@innovatian.com> wrote:
> It won't run at all on my machine.
>
>
>
> On Sun, Mar 28, 2010 at 11:48 PM, oliverw <mmo...@googlemail.com> wrote:
> > Do you have only a problem debugging the code or won't run the code at
> > all? If it runs at least perhaps you could use some old school trace
> > statements to figure out the area of the problem :)
>
> > On Mar 28, 9:44 pm, Ian Davis <ida...@innovatian.com> wrote:
> > > Can you figure out what is causing the bug ;)
>
> > > On Sun, Mar 28, 2010 at 11:35 AM, oliverw <mmo...@googlemail.com> wrote:
> > > > Btw is there anything I can do to help with fixing the problem?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "ninject" group.
> > > > To post to this group, send email to nin...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > ninject+u...@googlegroups.com<ninject%2Bunsu...@googlegroups.com >
> > <ninject%2Bunsu...@googlegroups.com<ninject%252Bunsubscribe@googlegroup s.com>>
1. I've verified that all Ninject internal components get added
correctly to the ComponentContainer
2. At some point during the initialization Ninject tries to resolve
IEnumerable<IActivationStrategy> in the Pipeline class
3. This crashes in ComponentContainer.cs:142 when it throws the
InvalidOperationException(ExceptionFormatter.NoSuchComponentRegistered(component));
4. The true cause for this lies in ComponentContainer.cs:135 where sub
expression "typeof(IEnumerable<>).IsAssignableFrom(gtd)"
returns False
I've created a new Windows Phone Class Library project. Included all
source files from a freshly fetched Ninject Github cloned repository
and defined the following constants to get it to build: SILVERLIGHT,
NO_PARTIAL_TRUST, NO_LCG, NO_WEB, NO_ASSEMBLY_SCANNING,
NO_EXCEPTION_SERIALIZATION
On Mar 28, 9:44 pm, Ian Davis <ida...@innovatian.com> wrote:
> Can you figure out what is causing the bug ;)
>
>
>
> On Sun, Mar 28, 2010 at 11:35 AM, oliverw <mmo...@googlemail.com> wrote:
> > Btw is there anything I can do to help with fixing the problem?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ninject" group.
> > To post to this group, send email to nin...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ninject+u...@googlegroups.com<ninject%2Bunsu...@googlegroups.com >
So we would need a workaround.
/// <summary>
/// Gets one instance of the specified component.
/// </summary>
/// <param name="component">The component type.</param>
/// <returns>The instance of the component.</returns>
public object Get(Type component)
{
Ensure.ArgumentNotNull(component, "component");
if (component == typeof(IKernel))
return Kernel;
if (component.IsGenericType)
{
Type gtd = component.GetGenericTypeDefinition();
Type argument = component.GetGenericArguments()[0];
#if !WPHONE
if (gtd.IsInterface && typeof(IEnumerable<>).IsAssignableFrom(gtd))
return GetAll(argument).CastSlow(argument);
#else
Type discreteGenericType =
typeof(IEnumerable<>).MakeGenericType(argument); // TODO: we should
probably cache this
if (gtd.IsInterface &&
discreteGenericType.IsAssignableFrom(component))
return GetAll(argument).CastSlow(argument);
#endif
}
Type implementation = _mappings[component].FirstOrDefault();
if (implementation == null)
throw new
InvalidOperationException(ExceptionFormatter.NoSuchComponentRegistered(component));
return ResolveInstance(component, implementation);
}
}
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
1. I've verified that all Ninject internal components get added
correctly to the ComponentContainer
2. At some point during the initialization Ninject tries to resolve
IEnumerable<IActivationStrategy> in the Pipeline class
3. This crashes in ComponentContainer.cs:142 when it throws the
InvalidOperationException(ExceptionFormatter.NoSuchComponentRegistered(comp onent));
4. The true cause for this lies in ComponentContainer.cs:135 where sub
expression "typeof(IEnumerable<>).IsAssignableFrom(gtd)"
returns False
I've created a new Windows Phone Class Library project. Included all
source files from a freshly fetched Ninject Github cloned repository
and defined the following constants to get it to build: SILVERLIGHT,
NO_PARTIAL_TRUST, NO_LCG, NO_WEB, NO_ASSEMBLY_SCANNING, NO_EXCEPTION_SERIALIZATION "
So far it doesn't seem to work - I keep getting a
"Error loading Ninject component IEnumerable{IActivationStrategy}
No such component has been registered in the kernel's component
container."
exception.
This is with the new Ninject 2.0 official release, using the
Silverlight 3 binaries.
}
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.