无法从程序集'NServiceBus.Core加载类型'GatewayDeduplication'

时间:2015-06-04 13:26:14

标签: ravendb nservicebus

我安装了RavenDB,然后在配置中我做了:

public static void ConfigurePersistence(BusConfiguration configuration)
        {

            var defaultStore = new DocumentStore
            {
                Url = "http://localhost:8085",
                DefaultDatabase = "MyTestb"
            }
             .RegisterListener(new UniqueConstraintsStoreListener())
            .Initialize();

            configuration.UsePersistence<RavenDBPersistence>()
                .DoNotSetupDatabasePermissions()
                .SetDefaultDocumentStore(defaultStore);
        }

当我运行项目时,我看到下面的错误:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load t
ype 'GatewayDeduplication' from assembly 'NServiceBus.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c'.
   at NServiceBus.Persistence.RavenDBPersistence..ctor()


 --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal
& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at NServiceBus.Utils.Reflection.ExtensionMethods.Construct[T](Type type) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Utils\Reflecti
on\ExtensionMethods.cs:line 22
   at NServiceBus.Persistence.PersistenceStartup.Run(Configure config) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Persistence\Persist
enceStartup.cs:line 32
   at NServiceBus.Configure.<Initialize>b__7(IWantToRunBeforeConfigurationIsFinalized t) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\C
onfigure.cs:line 114
   at NServiceBus.Configure.<>c__DisplayClasse`1.<ActivateAndInvoke>b__d(Type t) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Configure
.cs:line 180
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at NServiceBus.Configure.ForAllTypes[T](IList`1 types, Action`1 action) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Configure.cs:li
ne 138
   at NServiceBus.Configure.ActivateAndInvoke[T](IList`1 types, Action`1 action) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Configure
.cs:line 182
   at NServiceBus.Configure.Initialize() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Configure.cs:line 116
   at NServiceBus.Bus.Create(BusConfiguration configuration) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Bus.cs:line 21
   at NServiceBus.GenericHost.PerformConfiguration(Action`1 moreConfiguration) in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\
GenericHost.cs:line 121
   at NServiceBus.GenericHost.Start() in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 58

我无法找到为什么会这样。什么是

  

GatewayDeduplication我从未尝试加载此DLL我不关心这一点,但Nservicebus仍在尝试加载此DLL并失败。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

将NServiceBus软件包更新到最新版本(5.2.0),这应解决问题