Skip to content

InvalidOperationException using --trusted-signing-endpoint <Uri> #965

@bgrainger

Description

@bgrainger

Describe the bug

The -tse/--trusted-signing-endpoint command line option no longer accepts a URI.

Repro steps

Build the latest code from main.
Run:

dotnet .\artifacts\bin\Sign.Cli\Debug\net8.0\win-x64\sign.dll code trusted-signing -tse https://wus2.codesigning.azure.net/ -tsa YOUR_ACCOUNT -tscp YOUR_PROFILE -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256 .\artifacts\bin\Sign.Cli\Debug\net8.0\win-x64\sign.dll

Expected behavior

The endpoint is used for trusted signing.

Actual behavior

An InvalidOperationException is thrown:

Unhandled exception: System.InvalidOperationException: Cannot parse argument 'https://wus2.codesigning.azure.net/' for option '--trusted-signing-endpoint' as expected type 'System.Uri'.
   at System.CommandLine.Binding.ArgumentConverter.GetValueOrDefault[T](ArgumentConversionResult result)
   at System.CommandLine.Parsing.OptionResult.GetValueOrDefault[T]()
   at System.CommandLine.Parsing.SymbolResult.GetValue[T](Option`1 option)
   at System.CommandLine.ParseResult.GetValue[T](Option`1 option)
   at Sign.Cli.TrustedSigningCommand.<>c__DisplayClass15_0.<.ctor>b__0(ParseResult parseResult, CancellationToken cancellationToken) in C:\Code\sign\src\Sign.CLI\TrustedSigningCommand.cs:line 80
   at System.CommandLine.Invocation.AnonymousAsynchronousCommandLineAction.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

Additional context

  • Include the output of sign --version: 0.9.1-dev
  • Add any other context about the problem here.

I suspect this was introduced in c940e04; #959.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions