Description
I am using the commandline hosting and added
a custom model binder like shown here
command-line-api/src/System.CommandLine.Tests/Binding/ModelBinderTests.cs
Lines 661 to 668 in be7ff04
but the model binder is not used, as the logic tries to find the binder in the service collection, but it was not added before:
command-line-api/src/System.CommandLine.Hosting/HostingExtensions.cs
Lines 77 to 81 in be7ff04
when manually adding the model binder to service collection it gets used.
Is this the expected behavior to manually add the model binder to service collection or should it be enough when adding the model binder to the BindingContext
?
P.S. in a non dependency injection context the custom model binder works as expected.