2011-03-13 27 views
2

私は単純なNServiceBus Pub/Subの例を実行しようとしています。基本的には、私はコンソールアプリケーションとしてpub/subを持っています。私がそれらを実行すると、私はサブサイドで例外が発生しています。例外 "ファイルまたはアセンブリ 'Messages'またはその依存関係の1つを読み込めませんでした。 NServiceBus

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 

「メッセージ」というアセンブリが不足しているように見えますが、どこに見つけられないのかわかりません。

ありがとうございました。

答えて

3

UnicastBusConfigで指定された "メッセージ"(ほとんどの場合、サンプルの1つから設定をコピーして残っている可能性があります)があります。

0

メッセージタイプが別のアセンブリにあり、MessageクラスがNServiceBus IMessageインターフェイスを実装していることを確認する必要があります。

また、あなたのPubとSubの両方があなたのメッセージアセンブリを参照する必要があります(あなたは明らかに何かを呼び出すことができ、メッセージと呼ぶ必要はありません)。

関連する問題