我正在尝试在ASP.NET 5 Web应用程序中使用NServiceBus。当调用其中purchaseTransactionAddedEvent属于另一个名为Infrastructure.Contract的程序集中定义的PurchaseTransactionAddedEvent类型的IBus.Send(purchaseTransactionAddedEvent)时,我收到此错误:
消息=无法找到元数据 'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent'。请 确保以下内容: 1.'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent'包含在初始扫描中。 2.'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent'实现'IMessage','IEvent'或'ICommand'或者, 如果您不想实现界面,可以使用'Unobtrusive 模式'。源= NServiceBus.Core
我在配置端点时使用不显眼模式,如下所示:
busConfiguration.UseTransport<AzureServiceBusTransport>();
// we are using In memory persistence for messages
busConfiguration.UsePersistence<InMemoryPersistence>();
// NOTE: this is important and has to be set on publisher and subscriber endpoints.
// We are using unobstrusive mode, so our messages/events do not have to implement IMessage, IEvent, etc
var conventionsBuilder = busConfiguration.Conventions();
conventionsBuilder.DefiningEventsAs(t => t.Namespace != null && t.Namespace == "Infrastructure.Contract.Events");
但是这似乎不适用于新的ASP.NET 5文件夹安排。
已在NServiceBus上启用了日志记录,但它没有告诉我它正在扫描哪些程序集。鉴于ASP.NET 5不再具有bin文件夹,如何对此进行故障排除?