Skip to content

Binary API Breaking Change in 108.0.2 #1953

Closed

Description

@GKBelmonte

Describe the bug
The following change:
c969747?diff=split#diff-fd5240c0eeb1a04bc0c9ea9b5210c8a8ce6703011459c72d49ee4b0c08e61224R292

Introduces a default parameter to a number of extensions (FileParameterOptions? options = null)
Binaries previously compiled against the old version (lacking the default arg) will fail to find the method at runtime.

(see this answer on SO)

What will result, will be a runtime binding exception:

System.MissingMethodException: Method not found: 'RestSharp.RestRequest RestSharp.RestRequestExtensions.AddFile(RestSharp.RestRequest, System.String, Byte[], System.String, System.String)'.

To Reproduce

  1. Compile an assembly A using the method without the new default option (108.0.1)
    a. Expose that code path
  2. Create a new project that depends on both that assembly and uses 108.0.2
  3. Call the code path exposed in 1.a

Expected behavior
The method works succesfully

Stack trace
n/a

Desktop (please complete the following information):
n/a

Additional context
It is important that the assembly produced in step 1 is referenced as binary not as source (project), since its a binary breaking change, not a source breaking change.

The code of the assembly A would still compile, if REcompiled against version 108.0.2, it is the runtime binding that would fail.

Activity

  1. alexeyzimarev commented on Nov 7, 2022

    @alexeyzimarev
    Member

    You're right. I would gladly accept a PR where the method is reverted, and the new overloaded is added with options. Then, I can release it as a minor under 108.

  2. GKBelmonte commented on Nov 7, 2022

    @GKBelmonte
    Author

    I can do that after work :)

  3. alexeyzimarev commented on Nov 8, 2022

    @alexeyzimarev
    Member

    It wasn't as easy as I expected because of the optional parameters. So, it will be one more breaking change, but the impact would be only on people who use the options, and I don't think this feature is widely used.

  4. GKBelmonte commented on Nov 8, 2022

    @GKBelmonte
    Author

    ah thanks!
    I was looking at it yesterday, but turns out I didnt have the right VS installed, so I started download overnight.

  5. alexeyzimarev commented on Nov 8, 2022

    @alexeyzimarev
    Member

    No worries, I hope I can release it soon, so you can try.

  6. alexeyzimarev commented on Nov 8, 2022

    @alexeyzimarev
    Member

    Btw you can try the latest preview to make sure it works as expected.

  7. GKBelmonte commented on Nov 10, 2022

    @GKBelmonte
    Author

    Hey Alexey!
    Tried it locally, and it seems to work !

    I may have to try with a full open API gen with dotnet core, but at the very least locally it, with a binary ref and a proj ref, it works!

  8. alexeyzimarev commented on Nov 10, 2022

    @alexeyzimarev
    Member

    Noice, I will tag that version and release it.

  9. SamInfosoft commented on Jun 22, 2023

    @SamInfosoft

    I am getting this using Xero XeroAPI/Xero-NetStandard#472
    I suspect this fix didn't work. (using restsharp 110.2.0
    Rolling back to 108.0.1 fixes it.

  10. Jacko1394 commented on Aug 3, 2023

    @Jacko1394

    On 110.2.0 I also got this error while using Xero.NetStandard.OAuth2Client (1.6.0)

  11. alexeyzimarev commented on Aug 3, 2023

    @alexeyzimarev
    Member

    @Jacko1394 v110 is a major version so it is not expected to be binary compatible.

  12. added a commit that references this issue on Jan 27, 2024
    cbcc74b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions