2

3.3.2에서 3.3.3으로 업데이트 후 오류가 발생했습니다 github https://github.com/autofac/Autofac/issues/572#issuecomment-63236738에 문제점을 게시하고 요청해야하는 응답이 있습니다. 여기에 :)업데이트 후 오류 3.3.2에서 3.3.3까지

내 상황 아래

:

내가 무엇을 가지고 :

// Setup DI as default MVC controller factory 
DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); 

나는이 사용자 지정 멤버 자격 공급자의 주입 속성에 사용할 필요가

01 23,

문제 : 종속성 해결 프로그램은 유형이 아닌 'Autofac.Integration.Mvc.AutofacDependencyResolver'

이 문제를 해결하기 위해 도와주세요.

그래서 지금은 갱신 후 3.3.2에서

종속성 해결 유형 'Autofac.Integration.Mvc.AutofacDependencyResolver'이 아닌 및 표시되지 않습니다에 이러한 오류가 랩 할 필요가 UPDATE 캐슬 프로젝트의 DynamicProxy 사용. 이 문제는 DynamicProxy 구현이 변경되거나 종속성 해결 프로그램을 래핑하기 위해 다른 프록시 라이브러리를 사용하여 발생할 수 있습니다.

해결 방법에 대한 아이디어가 있습니까? 이미지 오류로

URL http://i.stack.imgur.com/yJJXX.png

UPDATE 내가 이것에 github.com/autofac/Autofac/blob/82cc138596e74095f50720319feb2a2ce734310d/Core/Source/Autofac.Integration.Mvc/AutofacDependencyResolver.cs 을 발견 한 것은 여기에 파일에 예외가 던져지는 파일이 있습니다. 이것은 모든 소스 코드에서 유일한 부분이므로 앞으로 나아가서 왜이 문제가 발생하는지 알아야 할 필요가 있다고 생각합니다. 또한 언제, 왜 내 코드가이 메소드 AutofacDependencyResolver.Current를 요청하는지. AutofacDependencyResolver.Current를 직접 호출하지 않았 음을 확인했습니다. 전화의 다른 변형 (장소)을 조사해야합니다. 지금은

+0

그러나 귀하의 질문은 무엇입니까? – Steven

+0

무엇이 오류였습니까? –

+0

내 문제 : 종속성 해결 프로그램이 'Autofac.Integration.Mvc.AutofacDependencyResolver'유형이 아닙니다 –

답변

0

나는 같은 해상도

 // Create DI container 
     var builder = new ContainerBuilder(); 

     // Register application modules 
     Autofac_RegisterApplicationModules(builder); 

     // Register filter provider 
     //builder.RegisterFilterProvider(); 

     // Register MVC specific abstractions (HttpRequestBase,HttpResponceBase etc) 
     builder.RegisterModule(new AutofacWebTypesModule()); 

     // container 
     var container = builder.Build(); 

당신은 내가이 행을

//builder.RegisterFilterProvider(); 

댓글을 달았하지만 그건 괜찮 만약 내가 확인이 필요 볼 수 있듯이를 참조!

올바른지 및/또는 방법이 무엇인지 설명하는 사람은 누구입니까? 아래

TRACE 결과 - 도움이 필요

[InvalidOperationException: The dependency resolver is not of type 'Autofac.Integration.Mvc.AutofacDependencyResolver' and does not appear to be wrapped using DynamicProxy from the Castle Project. This issue could be the result of a change in the DynamicProxy implementation or the use of a different proxy library to wrap the dependency resolver.] 
    Autofac.Integration.Mvc.AutofacDependencyResolver.get_Current() +367 
    Autofac.Integration.Mvc.AutofacFilterProvider.GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +196 
    System.Web.Mvc.FilterProviderCollection.GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +279 
    System.Web.Mvc.ControllerActionInvoker.GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +62 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +436 
    System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +82 
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151 
    System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +105 
    System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +588 
    System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +47 
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +65 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151 
    System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +139 
    System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +484 
    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +50 
    System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +98 
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151 
    System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +106 
    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +446 
    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +88 
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +50 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 

나의 새로운 조사 후 나는이 문제를 발견했다. 내 웹 사이트 MVCSiteMap

http://i.stack.imgur.com/7xnul.png

내가 DI를 변경하지 MvcSiteMapProvider을 구성하는 방법에 지금 확인하고 사용합니다.

<add key="MvcSiteMapProvider_UseExternalDIContainer" value="false" /> 

그래서 문제를 해결하려면 사실로 변경해야한다고 생각합니다. 지금 진행 중이며 곧 알려 드리겠습니다.

해결책이 있으면 내 의견을 자유롭게 업데이트하십시오! 이것에 의해

Autofac_RegisterApplicationModules(builder); 

그래서 내가 그것을 변경 :

RegisterAssemblyModules(builder); 

을하고 지금은 작동

+0

이 문제도 해결할 수 있지만 해결 방법을 모르겠습니다. 필터 공급자 등록을 중단하면 해당 공급자에 의존하는 코드에 문제가 발생하지 않습니까? – ChaseMedallion

+0

아래에 새로운 답변을 추가했습니다. 확인해주세요. –

0

나는 나를 위해이 줄을 작동하지 않았다.

솔루션을 제공해 주셔서 감사합니다.

+0

Autofac_RegisterApplicationModules (빌더); autofac 모듈과 RegisterAssemblyModules (빌더)를 등록한 나의 방법이었습니다. 거기. 제 생각에는 RegisterAssemblyModules (빌더)를 요청하지 않았기 때문에 문제가 발생한 것 같습니다. 그래서 그것은 내 문제와 관련이 없습니다. –

관련 문제