升级到.NET 4.6.1后无法使用Autofac解析

时间:2016-04-08 14:18:49

标签: dependency-injection autofac thinktecture-ident-server .net-4.6.1

我已在GitHub上发布了有关此内容的问题,并建议将其放在StackOverflow上:

自从更新到.NET 4.6.1以来,我遇到了ThinkTecture Authorization Server的问题。正如有些人所知,AuthorizationServer使用AutoFac(我们已经将其更新为Autofac 3.5.2)。

奇怪的是,在我的本地机器和DEV环境中一切正常,但它在INT上失败了! (所有这些环境都包含.NET 4.6.1):

我们在开始时遇到的问题就像这样:

  

[NullReferenceException:对象引用未设置为对象的实例。]      IsIT.SignonServices.Common.Logger..ctor()在c:\ Builds \ 23 \ 48 \ src \ IsIT.SignonServices.Common \ Logger \ Logger.cs:43      lambda_method(Closure,Object [])+140      Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()+271

     

[DependencyResolutionException:在调用构造函数时抛出异常' Void .ctor(Thinktecture.AuthorizationServer.Interfaces.IAuthorizationServerConfiguration)'在类型' TokenService'。 --->你调用的对象是空的。 (详见内部异常。)]      Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()+ 736      Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context,IEnumerable 1 parameters) +266 Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable 1个参数)+86      Autofac.Core.Resolving.InstanceLookup.Execute()+62      Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope,IComponentRegistration registration,IEnumerable 1 parameters) +170 Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +124 Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable 1个参数)+266      Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable 1 parameters) +86 Autofac.Core.Resolving.InstanceLookup.Execute() +62 Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable 1个参数)+170      Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration注册,IEnumerable 1 parameters) +109 Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable 1个参数,对象和实例)+122      Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context,Service service,IEnumerable`1 parameters)+70      Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(Type serviceType)+95      System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext,Type controllerType)+59

     

[InvalidOperationException:尝试创建类型为' Thinktecture.AuthorizationServer.OAuth2.AuthorizeController'的控制器时发生错误。确保控制器具有无参数的公共构造函数。]      System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext,Type controllerType)+240      System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext,String controllerName)+103      System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext,IController& controller,IControllerFactory& factory)+268      System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext,AsyncCallback回调,对象状态)+95      System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+ 921      System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously)+137

有人可以帮助,我认为这与反射/注射解决有关吗?

0 个答案:

没有答案