Handler with generic argument is not getting registered

I have been digging around in the code to find out why a handler is not getting registered. i have now found out that it is because it has generic arguments i.e. MyHander<T,M> … this was working in the old version (5) but not in 7.2 . This is mainly due to the change of assembly scanner that is auto scanning. Is there any way to get this working ? We need to have this as we have a large code base and support multiple versions of a class (e.g T where T:User).
We use RabbitMQTransport and NHibernate Persistence if that helps.
The handler is definitely not excluded and I did create a new handler (inheriting from the generic one) and it was registered.


Can you describe a bit more how the generic handlers were used? I struggle to reproduce the scenario. I defined a class MyHandler<MyMessage, T> but that class can’t be used to process messages of type MyMessage because NServiceBus does not know that value for T to use for any given message.


Yes that is the problem. Previously it worked because we would tell NServiceBus what to scan but now it does scan automatically! I think I will have to refactor some code.

@rezajp Yeah. I think that would be the best option.