Migrating app from Full Framework to .Net 5

45 views
Skip to first unread message

Russ Freeman

unread,
Dec 14, 2020, 5:59:30 AM12/14/20
to masstransit-discuss
TLDR: Should I adopt .Net Core style config or stick with existing Autofac-based config?

I'm in the process of converting our solution from .Net Framework 4.7.2. (MassTransit 5.x) to .Net Core ("Net 5") (MassTransit 7.x).   

I've managed to get things working but it resulted in me hacking apart our existing Autofac-based configuration to make it work.  In this world, we inject configuration and the various bus interfaces and everything is resolved in one go. It's a very clean setup.

With .Net Core, we now have this split between "Service setup" (ConfigureServices) and "Application Configuration" (Configure) and with Autofac integration, the container gets built between these two steps. 

The upshot of this is that is if I use the new ".Net Core way" of configuring MT (or anything else), i.e. in ConfigureServices(), you don't have the container available to inject the configuration - only IConfiguration.  With the Autofac way, we're doing all the configuration after ConfigureServices() in one place. 

So my question, from your experience of MT is:-
1) Are there any gotchas in keeping our Autofac-based config and doing all the bus config after ConfigureServices()?
2) Adopt the new .Net Core way of doing things, accept the split config  but keep Autofac
3) Do (2) and migrate from Autofac to Microsoft DI as well

Any experience and thoughts appreciated.









ttt

unread,
Dec 14, 2020, 6:17:18 AM12/14/20
to masstrans...@googlegroups.com
I did the same as you said, but in my case was Simple Injector. No problem here. 

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/df1f8006-58da-46ed-8203-43039570894fn%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages