AnsweredAssumed Answered

CA Wily breaks .NET applications using the Ninject library for dependency injection. (9.1.X.X / 9.5.X.X)

Question asked by kyle.engibous on Nov 26, 2014
Latest reply on Jul 28, 2015 by Florian_Cheval

I have several web applications that use the Ninject library for dependency injection and are meant to run as 64bit web applications.  However all requests to the application return -

 

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidProgramException: Common Language Runtime detected an invalid program.]

   System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IRuntimeMethodInfo method) +0

   System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType) +37

   Ninject.Injection.DynamicMethodInjectorFactory.Create(ConstructorInfo constructor) +849

   Ninject.Planning.Strategies.ConstructorReflectionStrategy.Execute(IPlan plan) +194

   Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map(IEnumerable`1 series, Action`1 action) +136

   Ninject.Planning.Planner.CreateNewPlan(Type type) +277

   Ninject.Planning.Planner.GetPlan(Type type) +123

   Ninject.Activation.Context.Resolve() +686

   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +265

   System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +300

   System.Linq.WhereSelectArrayIterator`2.MoveNext() +111

   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +472

   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +102

   Ninject.Activation.Providers.StandardProvider.Create(IContext context) +651

   Ninject.Activation.Context.Resolve() +315

   System.Linq.WhereSelectListIterator`2.MoveNext() +323

   System.Linq.<CastIterator>d__b1`1.MoveNext() +296

   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +552

   System.Linq.Enumerable.ToList(IEnumerable`1 source) +76

   Ninject.Web.Common.NinjectHttpModule.Init(HttpApplication context) +111

   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +597

   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +203

   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +389

   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +250

 

If i put the web application in 32bit mode it seems to work, but the application is meant to run as 64bit.  Is there any configuration in wily or any explanation on what the issue is here and how to resolve it or work around it without using 32bit mode?

Outcomes