Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system.notsupportedexception the static container already has a kernel associated with it #14

Open
Astechnology opened this issue Nov 18, 2014 · 0 comments

Comments

@Astechnology
Copy link

ASP.NET MVC5 NINJECT
system.notsupportedexception the static container already has a kernel associated with it

The static container already has a kernel associated with it!

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The static container already has a kernel associated with it!

Source Error:

Line 25: DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
Line 26: DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
Line 27: bootstrapper.Initialize(CreateKernel);
Line 28: }
Line 29:

Source File: d:\Projects\Astech\Systems\SportBettingSystem\Workspace\0.0.1\SportBettingSystem\SportBettingSysem.WebClient\App_Start\NinjectWebCommon.cs Line: 27

Stack Trace:

[NotSupportedException: The static container already has a kernel associated with it!]
Ninject.Web.KernelContainer.set_Kernel(IKernel value) +89
Ninject.Web.NinjectWebHttpApplicationPlugin.Start() +32
Ninject.Web.Common.Bootstrapper.b__0(INinjectHttpApplicationPlugin c) +29
Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map(IEnumerable1 series, Action1 action) +194
Ninject.Web.Common.Bootstrapper.Initialize(Func`1 createKernelCallback) +205
SportBettingSystem.WebClient.NinjectWebCommon.Start() in d:\Projects\Astech\Systems\SportBettingSystem\Workspace\0.0.1\SportBettingSystem\SportBettingSysem.WebClient\App_Start\NinjectWebCommon.cs:27

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +155
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivatorEx.BaseActivationMethodAttribute.InvokeMethod() +236
WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +619
WebActivatorEx.ActivationManager.RunPreStartMethods(Boolean designerMode) +48
WebActivatorEx.ActivationManager.Run() +75

[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection1 methods, Func1 setHostingEnvironmentCultures) +547
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930508
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant