Closed sfkoch closed 4 months ago
Hi @sfkoch; this change has now been published to NuGet in version 8.0.1-dev-00583 thanks to @ChristofferGersen's #405.
Are you able to check that package out and let us know whether your scenario is now fully covered? Many thanks!
I've confirmed that with version 8.0.1-dev-00583 I'm able to initialize CustomFields from appsettings.json where I wasn't able to in 7.0.0. Thank you!
Fantastic; thank you, @sfkoch 👍
I've been trying to configure Serilog.Sinks.Splunk.EventCollectorSink from appsettings.json, but can't get it to construct the CustomFields object for the "fields" parameter. When I provide an array of 3 CustomField objects, TryBuildCtorExpression is trying and failing to find a constructor for List<CustomField> that takes 3 arguments.
This is the JSON I've tried:
I also tried structuring "fields" for the fallback to ConfigurationBinding.Get in ObjectArgumentValue.ConvertTo, but that failed because CustomField doesn't have a default constructor.
Perhaps TryBuildCtorExpression needs something like TryCreateContainer from ConvertTo for when parameterType is a collection?