1

インターフェイスとして定義されているイベントを公開しようとしています。

Bus.Publish<IAccountCreated>(m => { m.Key = Guid.NewGuid(); });

JSONシリアライザーを使用すると、次のエラーが発生します。

Contracts.IAccountCreatedにマップされた具体的なタイプが見つかりませんでした

XMLシリアライザーで正常に動作します。

私のエンドポイント構成:

Configure.With()
    .DefaultBuilder()
    .JsonSerializer() <-- when this is here I get the error.
    .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Website"))
    .DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains("Contracts"))

NServiceBus3.3.3を使用しています。

4

1 に答える 1

2

流暢なインターフェースで物事を行う順序が重要であることがわかります。

これは機能します:

Configure.With()
    .DefaultBuilder()
    .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Website"))
    .DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains("Contracts"))
    .JsonSerializer() <-- moving this down works
于 2013-01-03T11:13:10.043 に答える