Is NServiceBus trim safe?

I’ve been looking at AOT and trimming to optimize docker image size for endpoints and hosts in general.

Is NServiceBus “trim safe” when it comes to AOT?

I’m guessing it uses assembly scanning with some reflection in there which would make it unlikely to be safe. If that is the case, are there plans to add source generation to give a more compliant registration setup.

Hi Mark!

At this time, we do not support AOT. Here is a link to the public issue that you can subscribe to. I would recommend adding a public comment on the issue describing your specific use case and requirements for this feature. Native AOT publish support · Issue #7230 · Particular/NServiceBus · GitHub