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

CommandLineParser throws when using streamdeck-tools in .NET 8 #83

Open
eXpl0it3r opened this issue Nov 21, 2024 · 0 comments
Open

CommandLineParser throws when using streamdeck-tools in .NET 8 #83

eXpl0it3r opened this issue Nov 21, 2024 · 0 comments

Comments

@eXpl0it3r
Copy link

When I upgraded my plugin to .NET 8, the plugin fails to start and logs the following:

Unhandled Exception: System.InvalidOperationException: Type BarRaider.SdTools.Payloads.StreamDeckOptions appears to be immutable, but no constructor found to accept values.
   at CommandLine.Core.InstanceBuilder.BuildImmutable[T](Type, Maybe`1, IEnumerable`1, IEnumerable`1, List`1)
   at CommandLine.Core.InstanceBuilder.<>c__DisplayClass1_0`1.<Build>b__5()
   at CommandLine.Core.InstanceBuilder.Build[T](Maybe`1, Func`3, IEnumerable`1, StringComparer, Boolean, CultureInfo, Boolean, Boolean, Boolean, IEnumerable`1)
   at CommandLine.Parser.ParseArguments[T](IEnumerable`1)
   at BarRaider.SdTools.SDWrapper.Run(String[], PluginActionId[], IUpdateHandler)
   at Clockify.Program.Main(String[]) in D:\a\streamdeck-clockify\streamdeck-clockify\Clockify\Program.cs:line 9

Here's the relevant code:

using BarRaider.SdTools;

namespace Clockify;

public static class Program
{
    public static void Main(string[] args)
    {
        SDWrapper.Run(args);
    }
}

It seems like some behavior with immutable types changed in .NET 8 which causes failures. When sticking to .NET 6, I'm not running into this issue.

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

No branches or pull requests

1 participant