Search code examples
c#.netnservicebus

NServiceBus 5.x to 6.x: NServiceBus.Host 7.0.1 + NServiceBus.Wcf = ambiguous type


We need to upgrade the NSB host in order to upgrade to NSB6, but we can't directly reference WcfService from the NServiceBus.Wcf namespace because they left the old WcfService class in the NServiceBus.Host 7.0.1 assembly and marked it as obsolete. Are we expected to use an assembly alias - do we have to switch over to the callback approach in order to upgrade to NSB 6?

While following the endpoint update instructions I followed the link to update NServiceBus.Host to v 7.0.1. The conventions in 7.0.1 seem to match the conventions in the core updates for NSB v6, but I get an ambiguous type error when I declare a stub for the WcfService:

public class SomeService : WcfService<SomeCommand, ErrorCodes>

You can get around that by using an assembly alias, but when I run the endpoint and attempt to hit the WCF service, a service is not found.

Thanks!


Solution

  • I found the issue. When converting our endpointconfig.cs files, I forgot to call our extension method that sets up the command/event conventions for discovery. No discovered commands = No Wcf Service.

    P.S. The NSB team updated their conversion docs to include the aliasing steps. If you're converting and using the host to handle WcfServices, you'll have to use the alias, but I can confirm it will work correctly.