Skip to content

DotMake.CommandLine v1.8.1

Compare
Choose a tag to compare
@calacayir calacayir released this 21 Feb 15:48
· 19 commits to main since this release
  • Added support for other dependency injection containers (e.g. Autofac) when
    only Microsoft.Extensions.DependencyInjection.Abstractions package (version >= 2.1.1) is added to the project.
    You can set your custom service provider with the extension method Cli.Ext.SetServiceProvider.
    In previous version, this method already existed but accepted a ServiceProvider parameter, instead of
    IServiceProvider parameter which allows 3rd party implementations other than the default one in Microsoft.Extensions.DependencyInjection.

    using DotMake.CommandLine;
    using Autofac.Core;
    using Autofac.Core.Registration;
    
    var cb = new ContainerBuilder();
    cb.RegisterType<object>();
    var container = cb.Build();
    
    Cli.Ext.SetServiceProvider(container);
    
    Cli.Run<RootCliCommand>();
  • Reduced minimum version requirement for Microsoft.Extensions.DependencyInjection from 6.0.0 to 2.1.1
    so that you don't need to update it in legacy projects. Added Cli.Ext.GetServiceCollection and
    Cli.Ext.GetServiceProviderOrDefault extension methods.