I'd like to register some services from another assembly with built-in IoC of .NET 6. Is it possible as Autofac does?
I found others nuget extensions, still not sure what it is the best practice
Thanks
Scrutor is the way. Just tried this example
var assembly = Assembly.LoadFile(@"path\stuff.dll");
builder.Services.Scan(scan => scan.FromAssemblies(assembly)
.AddClasses(classes => classes.AssignableTo<IMyInterface>())
.AsImplementedInterfaces()
.WithScopedLifetime());
It works, easier. Fantastic!