Comments (15)
Hi, what version of the .Net framework do you use? You can find this by right clicking on your project, selecting Properties and it will tell you under Target Framework.
from binance.net.
Hi, ive tried 4.5.1 4.5.2 and 4.5 - all give the same error.
Thanks
from binance.net.
Is it possible for you to start using 4.6.1? The Binance.Net package is targeting .NetStandard 2.0, which sadly means .Net framework versions older than 4.6.1 are not supported, sorry!
from binance.net.
Hi, i just tried 4.6.1 and again got the exact same error. Here is how little is in the test project and im getting the error. :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Binance.Net;
namespace CP4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (var client = new BinanceClient())
{
}
}
}
}
from binance.net.
Hm, that's weird. When I create a new .net 4.6.1 console project and add Binance.Net via the package manager it works. So I'm guessing it is something to do with your develop environment, although I'm not sure what it is..
from binance.net.
I just tried it in VS 2017 targetting .Net 4.6.1 and it compiles now but just hangs when i try and get prices from the exchange :(
from binance.net.
Can you try to run your code in a separate Task?
from binance.net.
Im sorry, i dont know what that means - im not a c# expert :)
from binance.net.
in a separate thread?
from binance.net.
Task.Run(() => {
using(var client = new BinanceClient())
{
// use client
}
});
from binance.net.
so i can now compile and run the extremely simple project, but i get no response, it just seems to run and do nothing. It can't be this hard?
from binance.net.
Hi, final comment before i give up on this.
everything in the example below compiles with no errors, textBox2.Text never gets populated.
(if i use c# WebClient Class i can talk to Binance exchange happily to get prices etc. so its not AV , Firewall etc)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Binance.Net;
namespace CP4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (var client = new BinanceClient())
{
textBox1.Text = "Before";
var ping = client.Ping();
textBox2.Text = "After";
}
}
}
}
from binance.net.
I guess i have to give up then.
Thats a shame, because this would have saved me a lot of hassle, but i just cant make the simplest use of Binance.Net work.
Thanks for trying anyway.
from binance.net.
The call hangs because you're trying to do an async await request from the UI thread, which probably isn't the best idea. If you use a seperate task for this as I suggested earlier it should work:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Binance.Net;
namespace CP4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
using (var client = new BinanceClient())
{
var result = client.Get24HPrice("ETHBTC");
if (result.Success)
{
Invoke(new MethodInvoker(() =>
{
textBox1.Text = "ETH price: " + result.Data.LastPrice;
}));
}
}
});
}
}
}
Note that the Invoke(new MethodInvoker() =>
is required because you update the UI from a different thread.
On another note, I've fixed some things in the latest version, if you download version 2.2.3 it should work with the code you had (no additional Task needed).
from binance.net.
Hi, Using a separate thread works :)
Thanks for your help (and patience)
from binance.net.
Related Issues (20)
- Update request to SideEffectType HOT 1
- Enum missing values: EXPIRED_IN_MATCH / TRADE_PREVENTION HOT 1
- GetLendingAccountAsync Deprecated HOT 3
- Binance RestClient: Error "You are not authorized to execute this request." when calling ConvertQuoteRequestAsync
- Is there any option for binance lead trader api connection and place order?
- SubscribeToOrderBookUpdatesAsync is not working for spot HOT 2
- BinanceSocketClient Orderbook explained
- BinanceSocketClient.UsdFuturesApi.SubscribeToTradeUpdatesAsync() Stream has sporadic price Updates which are NOT real HOT 8
- "SubscribeToUserDataUpdatesAsync" stop working after 9.5.0 HOT 2
- UsdFuturesApi - onOrderUpdate HOT 5
- Binance - Spot Trading Via WebSockets - Order Request Rate Limits HOT 1
- how set socket5 proxy on BinanceRestClient or BinanceSocketClient at first dircetly? HOT 2
- Missing BinanceSocketClient.UsdFuturesApi.Account.GetAccountInfoAsync ? HOT 1
- https://jkorf.github.io/Binance.Net/ It's broken HOT 4
- Performance issues HOT 3
- SimpleEarn => Signature for this request is not valid. HOT 2
- Missing AUTO_BORROW_REPAY HOT 1
- BinanceSocketClient - Can't connect to the server HOT 1
- GetMarginLoansAsync not adding a parameter to the parameter list HOT 1
- Issue with Nuget Package in Azure Functions project HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance.net.