You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the below code is valid but it throws an exception.
public static void Main(string[] args)
{
var extra = new Dictionary<string, string>();
string configFile;
var p = new OptionSet{
{"c|config", v => configFile = v},
{"p|pair", (string key, string val) => extra.Add(key, val)}
};
p.Parse(args);
}
Exception:
Unhandled exception. System.InvalidOperationException: Invalid ValueType with MaximumParameterCount of 2, expecting Optional or Required.
at NConsole.Options.Option.VerifyMaximumParameterCount()
at NConsole.Options.Option..ctor(String prototype, String description)
at NConsole.Options.InvokableActionOption`1..ctor(String prototype, String description, TCallback callback)
at NConsole.Options.KeyValueActionOption`2..ctor(String prototype, String description, OptionCallback`2 callback)
at NConsole.Options.OptionSet.<>c__DisplayClass22_0`2.<Add>b__0()
at NConsole.Options.OptionSet.Add(Delegate callback, Func`1 optionFactory)
at NConsole.Options.OptionSet.Add[TKey,TValue](String prototype, String description, OptionCallback`2 callback)
at NConsole.Options.OptionSet.Add(String prototype, String description, OptionCallback`2 callback)
at NConsole.Options.OptionSet.Add(String prototype, OptionCallback`2 callback)
at Program.Main(String[] args) in C:\Users\Alex\Projects\CSProbe\Program.cs:line 208
The text was updated successfully, but these errors were encountered:
@bambuk6 Thanks for the report. It is probably a bug in the Option class. That said, I am not actively maintaining it, so feel free to troubleshoot and submit a PR. I'll consider that and repackage as appropriate. Thank you.
I believe the below code is valid but it throws an exception.
Exception:
The text was updated successfully, but these errors were encountered: