Rebus icon indicating copy to clipboard operation
Rebus copied to clipboard

Native AOT with .NET 8

Open SbiCA opened this issue 1 year ago • 8 comments

Hi @mookid8000

Did you already try out using rebus with native AOT in .NET 8?

Do you already have an idea what's going to break? I guess the Router and Handler discovery might be affected?

Cheers

For people interested in it see https://youtu.be/km9CnGYBafI

SbiCA avatar Jun 06 '23 17:06 SbiCA

I haven't tried it yet 🙂 but if I understand things correctly, it's not reflection as such that causes things to break, it's more when reflection is used to load types that the AOT analyzer cannot predict are going to be loaded... and I can't recall any situations where Rebus does that.

E.g. I would assume that the AOT system will know that your handler is needed, because you did something like this:

services.AddRebusHandler<YourMessageHandler>();

so that type and its dependencies should be kept. But I might be wrong 😅 it would be fun to try though.

mookid8000 avatar Jun 13 '23 16:06 mookid8000

@SbiCA Did you ever have a chance to try out Rebus with AOT? Was there a determination of whether or not it works?

dguisinger avatar Jun 24 '24 23:06 dguisinger

@dguisinger nope I'm afraid not so if you made first experience I'd also be interested 😅

SbiCA avatar Jun 27 '24 19:06 SbiCA

@SbiCA hah, I've recently ripped out AutoMapper and MediatR because they didn't work with AoT and the project owner doesn't want to put time into making it work. I then spent time looking into Mass Transit and then realized it also doesn't work with AoT and their project owner has a similar attitude. I've pretty much given up on non-Microsoft frameworks at this point and don't want to waste more time evaluating things just to find they don't work with modern framework runtime options. Kind of disappointed MSFT just said they are holding back their event framework due to complaints... I bet it would have worked just fine out of the box.

dguisinger avatar Jun 27 '24 19:06 dguisinger