Ninject MVC3 extension ICache bug

820 vues
Accéder directement au premier message non lu

Matthijs

non lue,
25 févr. 2011, 04:03:4125/02/2011
à ninject
Hello,

I created a clean MVC 3 application, I added the Ninject NuGet package
to my application, and I added the NInject MVC3 extension. So I have a
clean application with no custom code except for the bootstrapping of
the Ninject MVC 3 extension. All fine and good, however, I can run the
application, but after 30 seconds NInject starts complaining it can't
resolve the ICache component. Is this a bug in the MVC 3 extension? I
am now using NInjectHttpApplication instead of the new bootstrapping,
and now it works fine.

Thanks,

Matthijs

Richard Wilburn

non lue,
25 févr. 2011, 14:52:2125/02/2011
à nin...@googlegroups.com
Hi Matthijs,

I believe those packages are currently unofficial packages (this has been discussed in past threads in this mail list) put on NuGet by microsoft. It would pay to download the official ones for now.

It has also been mentioned previously that in the future packages will be put on NuGet officially.

-Richard Wilburn.


--
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.


Remo Gloor

non lue,
26 févr. 2011, 06:30:2826/02/2011
à ninject
Hi Matthijs,

Thanks for your input. There is defenately a problem with the MVC3
NuGet version. I'm currently checking a propper way of shutting down
an application using the WebActivator with Davie Ebbo. In the mean
time you can remove the Dispose part of the
NinjectHttpApplicationModule. Unfortunately, the kernel and all none
transient objects will not be disposed after doing so. But I think we
will have a solution for this soon.

-Remo

On 25 Feb., 20:52, Richard Wilburn <rhwilb...@gmail.com> wrote:
> Hi Matthijs,
>
> I believe those packages are currently unofficial packages (this has been
> discussed in past threads in this mail list) put on NuGet by microsoft. It
> would pay to download the official ones for now.
>
> It has also been mentioned previously that in the future packages will be
> put on NuGet officially.
>
> -Richard Wilburn.
>

nslowes

non lue,
28 févr. 2011, 10:50:1028/02/2011
à ninject
I am also having an error crop up involving the ICache component, but
I am not using the NuGet MVC3 bootstrapper and I am not using
WebActivator. I did install Ninject itself from NuGet. I am using my
own controller factory to call the Ninject kernel. Everything works
fine for individual requests, but when I load test the application,
every request starts failing after a couple minutes with the ICache
error. The exception being thrown by Ninject is included below. None
of the suggestions seem to apply to my scenario. The Kernel is
created as a static in my Application_Start, so there should only be
one instance. Thanks for any assistance you can provide.

-Nick Slowes


System.InvalidOperationException: Error loading Ninject component
ICache
No such component has been registered in the kernel's component
container.

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.

at Ninject.Components.ComponentContainer.Get(Type component) in d:
\BuildAgent-01\work\b68efe9aafe8875e\src\Ninject\Components
\ComponentContainer.cs:line 131
at Ninject.Components.ComponentContainer.Get[T]() in d:
\BuildAgent-01\work\b68efe9aafe8875e\src\Ninject\Components
\ComponentContainer.cs:line 102
at Ninject.KernelBase.CreateContext(IRequest request, IBinding
binding) in d:\BuildAgent-01\work\b68efe9aafe8875e\src\Ninject
\KernelBase.cs:line 540
at
System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource
x)
at
System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1
source)
at Ninject.ResolutionExtensions.TryGet[T](IEnumerable`1 iterator)
in d:\BuildAgent-01\work\b68efe9aafe8875e\src\Ninject\Syntax
\ResolutionExtensions.cs:line 270
at
MetadataService.NinjectControllerFactory.CreateController(RequestContext
requestContext, String controllerName) in C:\Users\nslowes\Documents
\HG Code\CollectionServices\MetadataService
\NinjectControllerFactory.cs:line 28
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase
httpContext, IController& controller, IControllerFactory& factory)
at
System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<BeginProcessRequest>b__2()
at
System.Web.Mvc.SecurityUtil.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a()
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust[TResult]
(Func`1 func)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)

Remo Gloor

non lue,
28 févr. 2011, 12:16:1128/02/2011
à ninject
Hi nsolowes

Because you are using an own resolver you have to find the problem
yourself. Most likely you have disposed the kernel. I'd suggest
deriving from NinjectHttpApplication rather than using your own
implementation.

-Remo

Remo Gloor

non lue,
1 mars 2011, 15:11:1901/03/2011
à ninject
Hi Matthijs

This is fixed in Ninject.Web.MVC3 2.2.1.0 See
http://www.planetgeek.ch/2011/03/01/ninject-2-2-1-0-and-ninject-mvc3-2-2-1-0-released/
for more information

Thanks for your bug report
Remo
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message