natemcmaster / CommandLineUtils

Command line parsing and utilities for .NET

Home Page:https://natemcmaster.github.io/CommandLineUtils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not possible to implement subcommand by using the inheritance method and with ExecuteAsync method

barimale opened this issue · comments

Describe the bug
Not possible to implement subcommand by using the inheritance method and with ExecuteAsync method.

To Reproduce
Extracting the abstract class with the ExecuteAsync method, then implement it for command and subcommand as described in samples(https://github.com/natemcmaster/CommandLineUtils/tree/main/docs/samples/subcommands/inheritance).

Expected behavior
Possible to execute the subcommand.

Screenshots

Additional context
To achieve the goal I had to use builder-api for the subcommand only, so the atribute-based implementation of the command stays unchanged.

Which version of dotnet are you using? I just ran into this when I updated a project from being a netcoreapp3.1 to net7.0. I remember seeing the same behavior already with 6.0, but I don't have time right now to pin it to the exact version.

To me it feels like something must have changed with the Reflection behavior in dotnet.

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.