Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running nccs at master gives Unhandled Exception #721

Closed
devhawk opened this issue Mar 10, 2022 · 8 comments · Fixed by #724
Closed

Running nccs at master gives Unhandled Exception #721

devhawk opened this issue Mar 10, 2022 · 8 comments · Fixed by #724

Comments

@devhawk
Copy link
Contributor

devhawk commented Mar 10, 2022

Unhandled exception: System.ArgumentException: The SetHandler call for command 'nccs' is missing an Argument or Option for the parameter at position 0. Did you mean to pass one of these?

at System.CommandLine.Handler.GetValueForHandlerParameter[T](IValueDescriptor[] symbols, Int32& index, InvocationContext context)
at System.CommandLine.Handler.<>c__DisplayClass4_0`4.b__0(InvocationContext context)
at System.CommandLine.Invocation.AnonymousCommandHandler.<>c__DisplayClass2_0.<.ctor>g__Handle|0(InvocationContext context)
at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<b__0>d.MoveNext()

@devhawk
Copy link
Contributor Author

devhawk commented Mar 10, 2022

Appears to be caused by the move to System.CommandLine Version 2.0.0-beta3 and the line

            rootCommand.SetHandler<RootCommand, Options, string[], InvocationContext>(Handle);

@devhawk
Copy link
Contributor Author

devhawk commented Mar 10, 2022

@shargon @erikzhang this appears to be from #713

@devhawk
Copy link
Contributor Author

devhawk commented Mar 10, 2022

Yes, reverting the command line package, the SetHandler call and the Handle method code to the previous commit seems to solve the issue

@Jim8y
Copy link
Contributor

Jim8y commented Mar 11, 2022

This either be a bug or the new version does not support string[]. Suggest rollback System.CommandLine @shargon

Problem solve by change string[] to string. But its gonna change the logic of command line

@shargon
Copy link
Member

shargon commented Mar 11, 2022

If use IEnumerable<string> it works?

@Jim8y
Copy link
Contributor

Jim8y commented Mar 11, 2022

Nope

@erikzhang
Copy link
Member

Revert? But sooner or later we will have to upgrade.

@shargon shargon mentioned this issue Mar 17, 2022
@shargon
Copy link
Member

shargon commented Mar 17, 2022

Please check #724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants