Когда я пытаюсь запустить приложение ConsoleClient из решения «Примеры», оно работает нормально. Но это нацелено на .NET 8.0.
Затем я создал пустой консольный проект C#, ориентированный на .NET Framework 4.8, со следующим тривиальным кодом:
Код: Выделить всё
using Binance.Net.Clients;
using Binance.Net.Enums;
using CryptoExchange.Net.Authentication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
DoStuff();
for (; ; )
{
}
}
static async void DoStuff()
{
BinanceRestClient.SetDefaultOptions(options =>
{
options.ApiCredentials = new ApiCredentials("REMOVED", "APISECRET"); //
{
options.ApiCredentials = new ApiCredentials("REMOVED", "APISECRET");
});
using (var client = new BinanceRestClient())
{
var result = await client.SpotApi.ExchangeData.GetKlinesAsync("BTCUSDT", KlineInterval.OneHour);
System.Diagnostics.Trace.WriteLine(result.ToString());
}
}
}
}
- System.Threading.Tasks.Extensions.dll
- System.Text.Json.dll
- System.Text.Encodings.Web.dll
- System.Runtime.CompilerServices.Unsafe.dll
- System.Numerics.Vectors.dll System.Memory.dll
- System.Buffers.dll
- Microsoft.Extensions.Options.dll
- Microsoft.Extensions.Logging.Abstractions.dll
Код: Выделить всё
var result = await client.SpotApi.ExchangeData.GetKlinesAsync("BTCUSDT", KlineInterval.OneHour);
System.IO.FileNotFoundException: 'Не удалось загрузить файл или сборку
'Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.1, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' или одну из его зависимостей.
Система не может найти указанный файл.'
Я загрузил наиболее подходящую версию Microsoft.Bcl.AsyncInterfaces, которую смог найти, в которой указаны версия файла 10.0.225.61305 и версия продукта 10.0.2+4452024595742ebe09023abe... но она не принимается и по-прежнему выдает ту же ошибку. сообщение.
Когда я смотрю журнал, созданный Fusion++, я получаю следующее:
Код: Выделить всё
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
(Fully-specified)
LOG: Appbase = file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ConsoleApp1.exe
Calling assembly : System.Text.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\xxxxxxxxxxxx\Downloads\Binance.Net-master\Examples\ConsoleApp1\bin\Debug\ConsoleApp1.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 10.0.0.0 redirected to 10.0.0.1.
LOG: Post-policy reference: Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces.EXE.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.EXE.
LOG: All probing URLs attempted and failed.
*** Assembly Binder Log Entry (02/02/2026 @ 14:29:05) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Users\xxxxxxxxxxxx\Downloads\Binance.Net-master\Examples\ConsoleApp1\bin\Debug\ConsoleApp1.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
(Fully-specified)
LOG: Appbase = file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ConsoleApp1.exe
Calling assembly : System.Text.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\xxxxxxxxxxxx\Downloads\Binance.Net-master\Examples\ConsoleApp1\bin\Debug\ConsoleApp1.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 10.0.0.0 redirected to 10.0.0.1.
LOG: Post-policy reference: Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces.EXE.
LOG: Attempting download of new URL file:///C:/Users/xxxxxxxxxxxx/Downloads/Binance.Net-master/Examples/ConsoleApp1/bin/Debug/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.EXE.
LOG: All probing URLs attempted and failed.
Подробнее здесь: https://stackoverflow.com/questions/798 ... pplication
Мобильная версия