Closed
Description
when build found the following errors with ver 6.0.1 and. netcore6.0:
Unhandled exception. System.ArgumentException: Type Coverlet.Core.Enums.ThresholdStatistic cannot be created without a custom binder.
at System.CommandLine.Binding.ArgumentConverter.CreateEnumerable(Type type, Type itemType, Int32 capacity)
at System.CommandLine.Binding.ArgumentConverter.ConvertTokens(Argument argument, Type type, IReadOnlyList`1 tokens, LocalizationResources localizationResources, ArgumentResult argumentResult)
at System.CommandLine.Binding.ArgumentConverter.TryConvertArgument(ArgumentResult argumentResult, Object& value)
at System.CommandLine.Parsing.ArgumentResult.Convert(Argument argument)
at System.CommandLine.Parsing.ArgumentResult.GetArgumentConversionResult()
at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertArgumentResult(ArgumentResult argumentResult)
at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertOptionResult(OptionResult optionResult)
at System.CommandLine.Parsing.ParseResultVisitor.Stop()
at System.CommandLine.Parsing.ParseResultVisitor.Visit(SyntaxNode node)
at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList`1 arguments, String rawInput)
at System.CommandLine.CommandExtensions.GetDefaultInvocationPipeline(Command command, String[] args)
at System.CommandLine.CommandExtensions.Invoke(Command command, String[] args, IConsole console)
at Coverlet.Console.Program.Main(String[] args) in /_/src/coverlet.console/Program.cs:line 134
After checking, I found that the reason is due to the following parameters: --threshold-stat total , Restore normal after removing this parameter
Following is full command:
coverlet xxxx.Test.dll --target "dotnet" --targetargs "test ./ --no-build" --threshold 80 --threshold-type line --threshold-stat total --format opencover