dotnet / dotnet/command-line-api
Method-first wiki example does not build
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
The example given here: https://github.com/dotnet/command-line-api/wiki/How-To#method-first does not build
```cs
static void Main()
{
var rootCommand = new RootCommand();
MethodInfo method = typeof(Program).GetMethod(nameof(DoSomething));
rootCommand.ConfigureFromMethod(method);
rootCommand.InvokeAsync(args).Wait();
}
```
More precisely:
```cs
static void Main()
```
- missing `string[] args`
```cs
rootCommand.ConfigureFromMethod(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;`
Contributor guide
Assessment
This issue has not been assessed yet.