<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.7" />

Microsoft.Extensions.DependencyInjection.ActivatorUtilities

public static class ActivatorUtilities
Helper code for the various activator services.
namespace Microsoft.Extensions.DependencyInjection { public static class ActivatorUtilities { public static object CreateInstance(IServiceProvider provider, Type instanceType, params object[] parameters); public static ObjectFactory CreateFactory(Type instanceType, Type[] argumentTypes); public static ObjectFactory<T> CreateFactory<[System.Runtime.CompilerServices.Nullable(2)] [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] T>(Type[] argumentTypes); public static T CreateInstance<[System.Runtime.CompilerServices.Nullable(2)] [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider, params object[] parameters); public static T GetServiceOrCreateInstance<[System.Runtime.CompilerServices.Nullable(2)] [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider); public static object GetServiceOrCreateInstance(IServiceProvider provider, Type type); } }