2010-04-05 4 views
2

(VS 2010 및 .NET 4.0 프레임 워크를 사용하여) ASP.NET MVC 2 웹 사이트에서 NServiceBus를 사용하려고합니다. NServiceBus.2.0.0.1145 바이너리 다운로드NServiceBus가있는 ASP.NET MVC 2에서 요청한 유형을로드 할 수 없습니다.

  • : 여기

    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    는 관련 I 촬영 한 단계입니다 내 로컬 컴퓨터에서 사이트를 실행할 때, 나는 다음과 같은 오류가 발생합니다

: 내 asp.net MVC 응용 프로그램에서
  • , 나는 내가 추가 한 Global.asax.cs에서 NServiceBus.dll 및 NServiceBus.Core.dll
  • 에 대한 참조를 추가 한 Web.config의에서
    public static IBus Bus { get; private set; } 
    protected void Application_Start() 
    { 
        AreaRegistration.RegisterAllAreas(); 
        RegisterRoutes(RouteTable.Routes); 
    
        Bus = NServiceBus.Configure 
         .WithWeb() 
         .Log4Net() 
         .DefaultBuilder() 
         .XmlSerializer() 
         .MsmqTransport() 
          .IsTransactional(false) 
          .PurgeOnStartup(false) 
         .UnicastBus() 
          .ImpersonateSender(false) 
         .CreateBus() 
         .Start(); 
    } 
    
    • 는, 내가 추가 한 :
    <MsmqTransportConfig 
        InputQueue="MyWebClient" 
        ErrorQueue="error" 
        NumberOfWorkerThreads="1" 
        MaxRetries="5"/> 
    
    <UnicastBusConfig> 
        <MessageEndpointMappings> 
        <add Messages="Messages" Endpoint="MyServerInputQueue"/> 
        </MessageEndpointMappings> 
    </UnicastBusConfig> 
    

    오류가 문제가 Global.asax.cs 파일의 첫 번째 줄에 있음을 나타냅니다. .NET 4.0에서 실행되는 NServiceBus에 문제가있을 수 있습니까?

  • 답변

    7

    확인은 LoaderExceptions과) 대신 Configure.WithWeb (의 다음 Configure.With (AllAssemblies.Except ("problematicAssembly.dll"을 호출하여 제외, 조립 그것에 대해 불평하는 참조) 유창 초기화 코드의 나머지 부분을 남겨 동일한.

    +0

    비슷한 문제가 있습니다. 아마도 이것은 바보 같은 질문이지만, LoaderExceptions를 어디에서 확인해야합니까? 나는 IoC 컨테이너를 사용하는 것에 대해 아주 새로운데, 이것은 아마 문제 일 것이다. Throw- –

    +0

    LoaderExceptions은 throw 된 예외의 속성입니다. –

    2

    나는 동일한 문제가있다 .Udi 제안으로 LoaderExceptions를 확인할 때 문제가 어셈블리 "Antlr3.Runtime.dll"로 식별되었습니다.이 어셈블리는 내 프로젝트에서 직접 참조되지 않지만 NHibernate .dll 참조 된.

    따라서 (With AllAssemblies.Except ("Antlr3.Runtime.dll")) 나를 위해 그것을 해결하지 못했습니다, 나는 With (AllAssembl ies.Except ("NHibernate.dll")).

    따라서이 문제가 발생하고 어셈블리를 직접 제외해도 문제가 해결되지 않으면 Reflector에서 참조 된 어셈블리 종속성을 검사하여 문제의 원인을 확인하십시오. 희망이 비슷한 문제가있는 사람을 도울 수 있기를 바랍니다 ...

    0

    rob과 비슷하지만 바인딩 리디렉션을 추가하고 내 문제를 해결했습니다. 내 deploy.ps1이 실패했으며 다시 컴파일하지 않으려했습니다.

    <runtime> 
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
         <dependentAssembly> 
          <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /> 
          <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /> 
         </dependentAssembly> 
        </assemblyBinding> 
    </runtime> 
    
    관련 문제