Is there akin to Java’s java.util.ServiceLoader, which allows components to be looked up and loaded up dynamically through an SPI?
I’m looking for some lightweight native feature of .NET that allows me to easily plug-in providers of interfaces, rather than bulky DI containers or having to write it myself.
Update: This does not appear to be readily available on .NET, as there’s no SPI feature natively build-in like in Java. I accepted the first answer since it’s the closest to what I am after.
There is a native IServiceProvider interface.
That said, there are tons of very rich IoC containers available for .NET
to name a few. Many of these are pretty lightweight. They also offer advanced features such as object lifetime management (singleton, per thread, etc.) and AOP (aspect oriented programming) features.
That said, if you really want lightweight and no dependencies, you could roll your own in about 30 lines of code.