Nservicebus 例外情况;无法加载文件或程序集';信息';或它的一个依赖项。”;N服务总线

Nservicebus 例外情况;无法加载文件或程序集';信息';或它的一个依赖项。”;N服务总线,nservicebus,Nservicebus,我只是尝试运行一个简单的NServiceBus发布/订阅示例。基本上,我使用pub/sub作为控制台应用程序,当我运行它们时,sub端会出现异常 Exception was unhandled by user code Message=Exception when starting endpoint, error has been logged. Reason: Error creating object with name 'NServiceBus.Unicast.UnicastBus'

我只是尝试运行一个简单的NServiceBus发布/订阅示例。基本上,我使用pub/sub作为控制台应用程序,当我运行它们时,sub端会出现异常

Exception was unhandled by user code
  Message=Exception when starting endpoint, error has been logged. Reason: Error creating object with name 'NServiceBus.Unicast.UnicastBus' : Error setting property values: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are: 
[Spring.Core.TypeMismatchException: Cannot convert property value of type [System.Collections.Hashtable] to required type [System.Collections.IDictionary] for property 'MessageOwners'., Inner Exception: System.ArgumentException: Problem loading message assembly: Messages ---> System.IO.FileNotFoundException: Could not load file or assembly 'Messages' or one of its dependencies. The system cannot find the file specified.
File name: 'Messages'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at NServiceBus.Unicast.UnicastBus.ConfigureMessageOwners(IDictionary owners) in d:\BuildAgent-02\work\20b5f701adefe8f8\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 1204
看起来我缺少名为“消息”的程序集,但我不确定在哪里可以找到它


谢谢。

我不太清楚问题是什么,但是,您必须确保您的消息类型位于单独的程序集中,并且您的消息类实现了NServiceBus IMessage接口


此外,您的发布和订阅都需要引用您的消息程序集(您可以调用任何东西,显然,您不必将其称为消息)。

最有可能的情况是,您在UnicastBusConfig中指定了“消息”(可能是从一个示例复制配置后留下的)