I am trying to use NServiceBus in an ASP.NET 5 Web application. When invoking IBus.Send(purchaseTransactionAddedEvent) where purchaseTransactionAddedEvent is of type PurchaseTransactionAddedEvent defined in another assembly called Infrastructure.Contract, I get this error:
Message=Could not find metadata for 'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent'. Please ensure the following: 1. 'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent' is included in initial scanning. 2. 'Infrastructure.Contract.Events.PurchaseTransactionAddedEvent' implements either 'IMessage', 'IEvent' or 'ICommand' or alternatively, if you don't want to implement an interface, you can use 'Unobtrusive Mode'. Source=NServiceBus.Core
I am using Unobtrusive Mode when configuring the endpoint as follows:
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");
But this does not appear to be working within the new ASP.NET 5 folder arrangement.
Logging has been enabled on NServiceBus but it does not tell me what assemblies it is scanning. Given that ASP.NET 5 no longer has a bin folder, how does one go about troubleshooting this?