dotnet-config icon indicating copy to clipboard operation
dotnet-config copied to clipboard

DotNetConfig.CommandLine not compatible with latest prerelease of System.Commandline

Open safesparrow opened this issue 3 years ago • 1 comments

Describe the Bug

Using the latest version of DotNetConfig.CommandLine - 1.0.6 with the latest version of System.CommandLine - 2.0.0-beta4.22272.1 causes type load error.

Steps to Reproduce

  1. Create a basic console app with the above versions of both packages.
  2. Create a root command, call RootCommand.WithConfigurableDefaults().
  3. Run the program

Expected Behavior

The app does not crash.

Exception with Stack Trace

Unhandled exception. System.TypeLoadException: Could not load type 'System.CommandLine.IArgument' from assembly 'System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at System.CommandLine.CommandLineExtensions.WithConfigurableDefaults[T](T command, String section, Config configuration)
   at Program.<Main>$(String[] args) in C:\App\Program.cs:line 53
   at Program.<Main>(String[] args)

Version Info

  • DotNetConfig.CommandLine - 1.0.6
  • System.CommandLine - 2.0.0-beta4.22272.1

safesparrow avatar Jul 30 '22 12:07 safesparrow

Yep, the upstream API is changing a lot between releases, I just can't keep up fast enough. If you could take a shot at this in a PR, it would be great!

Otherwise, I'm planning on sitting this one out until it's stable and ships.

kzu avatar Aug 02 '22 15:08 kzu

upstream STILL not close to being stable. Closing this for now, please reopen when they do ship. It looks like it will require substantial rework.

kzu avatar Jun 25 '24 09:06 kzu