抛出与OnePerRequestModule相关的Ninject Intermittent异常

rei*_*nir 6 ninject httpmodule ninject.web ninject-2

我刚刚将Ninject的现有实现从1.5升级到2.0.我现在看到在短时间内发生许多请求时会出现间歇性异常.

这是抛出的异常.

类型: System.ArgumentException
消息:已添加具有相同键的项.
来源: Ninject
堆栈跟踪: 在System.ThrowHelper.ThrowArgumentException(ExceptionResource资源)
在System.Collections.Generic.Dictionary`2.Insert(TKEY的关键,TValue值,布尔加)
在System.Collections.Generic.Dictionary`2.Add (TKEY的键,TValue值)
在Ninject.Components.ComponentContainer.CreateNewInstance(类型分量类型的实现)
在Ninject.Components.ComponentContainer.ResolveInstance(类型分量类型的实现)
在Ninject.Components.ComponentContainer.Get(类型分量)
在Ninject.Components.ComponentContainer <CreateNewInstance> b__6(的ParameterInfo参数)
在System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
在System.Linq.Buffer`1..ctor(IEnumerable`1源)
在System.Linq的.inumerable.ToArray [TSource](IEnumerable`1 source)
位于Ninject.Compone上的Ninject.Compone上的Ninject.Components.Component.CreateNewInstance(类型组件,类型实现)
Ninject.Compone上的Ninject.Compone上的Ninject.Components.Component.ResolveInstance(Type组件,类型实现)
. 在Ninject.KernelBase.CreateContext(IRequest请求,IBinding绑定)的
Ninject.Components.ComponentContainer.GetT 获取(类型组件
)
在Ninject.KernelBase.<> c__DisplayClassa.<解决> b__6(IBinding结合)
在System.Linq.Enumerable.<> c__DisplayClass12`3.<CombineSelectors> b__11(TSource X)
在System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext ()
在System.Linq.Enumerable.<CastIterator> d__aa`1.MoveNext()
在System.Linq.Enumerable.Single [TSource](IEnumerable`1源)
在Ninject.ResolutionExtensions.Get [T](IResolutionRoot根,IParameter []参数)
NameOfConsumingSite .Application_BeginRequest(Object sender,EventArgs e)...

如果我OnePerRequestModulehttpModulesweb.config中删除该项,则不会抛出异常,但这会增加大量开销.

如果他们可以提供帮助我提前感谢任何人!

Rem*_*oor 3

存在多线程问题。尝试使用https://github.com/ninject上找到的 2.2 RC1 。请告诉我此版本是否仍然出现此问题,以确保我们在发布之前没有需要修复的进一步问题。