alpacahq/alpaca-trade-api-csharp

[BUG]: System.TypeLoadException: Method 'GetTradeSubscription' in type 'ClientWithReconnection' from assembly 'Alpaca.Markets.Extensions, [...] does not have an implementation.

woaksie opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I just updated all Nuget packages and now I get an error when I run this code.

var securityKey = new SecretKey(API_KEY, API_SECRET);

ReconnectionParameters reP = new ReconnectionParameters
{
    MaxReconnectionAttempts = 100
};

_streamingClient = Environments.Paper.GetAlpacaStreamingClient(securityKey).WithReconnect(reP);
await _streamingClient.ConnectAndAuthenticateAsync().ConfigureAwait(true);

_streamingClient.OnTradeUpdate += HandleTradeUpdate;

if (Runner.LiveMode)
{
    _streamingData = Environments.Paper.GetAlpacaDataStreamingClient(securityKey).WithReconnect(reP);
    await _streamingData.ConnectAndAuthenticateAsync().ConfigureAwait(true);
}

The error is

System.TypeLoadException: Method 'GetTradeSubscription' in type 'ClientWithReconnection' from assembly 'Alpaca.Markets.Extensions, Version=6.2.0.2, Culture=neutral, PublicKeyToken=16fb7a27ac3b9689' does not have an implementation.
   at Alpaca.Markets.Extensions.AlpacaDataStreamingClientExtensions.WithReconnect(IAlpacaDataStreamingClient client, ReconnectionParameters parameters)
   at TestingAlpaca.AlpacaGateway.SetUpListenerForTrades() in D:\Projects\STOCKS\TestingAlpaca\AlpacaGateway.cs:line 207

image

Expected Behavior

This used to run without an exception.

Environment

  • SDK Version: 6.2.1 and Extensions 6.2.0
  • OS (version, bitness): Windows 10 Pro 22H2 64bit
  • .NET SDK (version): 4.8.9037.0
  • target process .NET version/bitness: 4.8.9037.0 64bit

@woaksie Please, try to upgrade the Extensions package to version 6.2.1 available on NuGet - it should solve the problem.

Ok, it is not throwing that exception anymore.