NServiceBus.Unity : System.TypeLoadException

I would like to register the NServiceBus endpoint with Unity in order to resolve the IEndpontInstance interface.

Unfortunatly, this line throws an exception:

var endpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();

Exception:System.TypeLoadException: ‘Method ‘GetValue’ in type ‘NServiceBus.Unity.SingletonLifetimeManager’ from assembly ‘NServiceBus.ObjectBuilder.Unity, Version=, Culture=neutral, PublicKeyToken=9fc386479f8a226c’ does not have an implementation.’

I’ve tried to exclude that assembly but without success.

Any help is very much welcome.

Kind regards


Is it possible to provide more information about the actual endpoint configuration code? Or maybe even have a gist or a repro somewhere so that we can have a look at it?