You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
Compile an assembly A using the method without the new default option (108.0.1)
a. Expose that code path
Create a new project that depends on both that assembly and uses 108.0.2
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.
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.
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.
Activity
alexeyzimarev commentedon Nov 7, 2022
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.
GKBelmonte commentedon Nov 7, 2022
I can do that after work :)
alexeyzimarev commentedon Nov 8, 2022
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.
GKBelmonte commentedon Nov 8, 2022
ah thanks!
I was looking at it yesterday, but turns out I didnt have the right VS installed, so I started download overnight.
alexeyzimarev commentedon Nov 8, 2022
No worries, I hope I can release it soon, so you can try.
alexeyzimarev commentedon Nov 8, 2022
Btw you can try the latest preview to make sure it works as expected.
GKBelmonte commentedon Nov 10, 2022
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!
alexeyzimarev commentedon Nov 10, 2022
Noice, I will tag that version and release it.
SamInfosoft commentedon Jun 22, 2023
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.
Jacko1394 commentedon Aug 3, 2023
On 110.2.0 I also got this error while using Xero.NetStandard.OAuth2Client (1.6.0)
alexeyzimarev commentedon Aug 3, 2023
@Jacko1394 v110 is a major version so it is not expected to be binary compatible.
Removed ExternalInit reference in favour of inline code