conductor-sdk / conductor-csharp

The conductor-csharp repository provides the client SDKs to build task workers in C#
Apache License 2.0
41 stars 16 forks source link

RestClient Issue in SDK? #87

Closed jkergosi closed 7 months ago

jkergosi commented 1 year ago

When referencing the conductor-csharp SDK below, I get:

An error occurred while starting the application. MissingMethodException: Method not found: 'Void RestSharp.RestClient..ctor(System.String)'. Conductor.Client.ApiClient..ctor()

public WorkflowService(string url, OrkesAuthenticationSettings settings) { --> var config = new Configuration { BasePath = url, AuthenticationSettings = settings }; _workflowClient = config.GetClient(); }

I've confirmed url and settings are correct. When I load the SDK source directly, it gives the same error.

Please advise, Thanks!

jkergosi commented 1 year ago

any thoughts on this?

mross002 commented 9 months ago

Had the same issue, drove me crazy, root cause was because we were using a newer version of RestSharp (v108.0.3) in another project, and conductor.client has a dependency on RestSharp - when our Api was compiled it took / used the newer version, resulting in this method not found error. NuGet reports conductor.client has a dependency of >=RestSharp v106.13.0, but I think that is inaccurate (or a half truth) - I had to downgrade all references of RestSharp across all my projects using it to RestSharp (and RestSharp.Serializers.NewtonsoftJson) to v106.15.0, and then all worked after cleaning / rebuilding. I think v106.13.0 - 106.15.0 also worked, I don't recall precisely though, I do know that we're currently using 106.15.0 and that resolved the issue. So it's not necessarily that >=106.13.0, but rather >=106.13.0 and <=v106.15.0 (at least from my experience).

Just remember to update all refs to RestSharp to this version, I spent hours because I missed one. There's a number of breaking changes as well between RestSharp versions, so you may need to make some additional code changes based on your usages of RestSharp, e.g. response.IsSuccessStatusCode --> response.IsSuccessful

v1r3n commented 8 months ago

cc: @BommannanRa