bchavez / Coinbase

:moneybag: A .NET/C# implementation of the Coinbase API.
https://developers.coinbase.com/api/v2
MIT License
170 stars 92 forks source link

'Could not load type 'Flurl.Http.HttpCall' from assembly 'Flurl.Http #73

Closed JesperKuipers closed 3 years ago

JesperKuipers commented 3 years ago

Version Information

Software Version(s)
NuGet Package 5.1.2.0
.NET Core? idk
.NET Full Framework? 4.7.2
Windows OS? last stable build
Linux OS? no
Visual Studio? last stable version

What's the problem?

'Could not load type 'Flurl.Http.HttpCall' from assembly 'Flurl.Http, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null'.'

What possible solutions have you considered?

reinstalling framework, debugging to make sure the API key and secret API key is working

Do you have a sample code to show what you're trying to do?

image

What is the HTTP request JSON and response JSON?

image

bchavez commented 3 years ago

@JesperKuipers if you downgrade the Flurl.Http nuget package to 2.4.2; and clean/rebuild does the issue go away?

I suspect this is because Coinbase is built against Flurl.Http 2.4.0 and the v3.0+ Flurl.Http is incompatible.

JesperKuipers commented 3 years ago

I will try that thanks

JesperKuipers commented 3 years ago

Still this error: System.TypeLoadException: 'Could not load type 'Flurl.StringExtensions' from assembly 'Flurl, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null'.'

But i found that FLurl has the version 3.0.10. so it wanst flurl.http.

Which version do you recommend for the flurl?

JesperKuipers commented 3 years ago

Okay 2.8.0.0 works for me but now I get a new error:

Flurl.Http.FlurlHttpException HResult=0x80131500 Message=Call failed. An error occurred while sending the request. GET https://api.coinbase.com/v2/prices/ETH-USD/spot Source=Flurl.Http StackTrace: at Flurl.Http.FlurlRequest.d23.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Flurl.Http.FlurlRequest.d19.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Flurl.Http.FlurlRequest.d19.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Flurl.Http.HttpResponseMessageExtensions.d01.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at CoinBaseClient.Form1.d__3.MoveNext() in C:\Users\jespe\source\repos\CoinBaseClient\CoinBaseClient\Form1.cs:line 46 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at CoinBaseClient.Form1.d__4.MoveNext() in C:\Users\jespe\source\repos\CoinBaseClient\CoinBaseClient\Form1.cs:line 56

This exception was originally thrown at this call stack: [External Code]

Inner Exception 1: HttpRequestException: An error occurred while sending the request.

Inner Exception 2: WebException: Unable to connect to the remote server

Inner Exception 3: SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8888

JesperKuipers commented 3 years ago

Ah i forgot to remove the client.EnableFiddlerDebugProxy("http://localhost.:8888"); My Coinbase is IP locked aswell so ye thats on me. Thank you