Skip to content

Method-first wiki example does not build #1065

Open
@teraa

Description

@teraa

The example given here: https://github.com/dotnet/command-line-api/wiki/How-To#method-first does not build

static void Main()
{
    var rootCommand = new RootCommand();

    MethodInfo method = typeof(Program).GetMethod(nameof(DoSomething));

    rootCommand.ConfigureFromMethod<int, string>(method);

    rootCommand.InvokeAsync(args).Wait();
}

More precisely:

static void Main()
  • missing string[] args
rootCommand.ConfigureFromMethod<int, string>(method);
  • Gives error: 'RootCommand' does not contain a definition for 'ConfigureFromMethod' and no accessible extension method 'ConfigureFromMethod' accepting a first argument of type 'RootCommand' could be found (are you missing a using directive or an assembly reference?)
    even with using System.CommandLine.DragonFruit;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions