Skip to content

CobinhoodClient calls not returning if the Microsoft Chart constructor is called. #1

Description

@neuronz

Hi Jose,
Thanks for writing this library, I'm sure I will be using it in the near future.
However, currently there is an issue when using it alongside the Microsoft Charting library. See: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.datavisualization.charting.chart?view=netframework-4.7.2

If I uncomment the commented-out 'new Chart()' line below, the Chart() constructor call, later prevents the 'GetSystemTime()' from returning.

Specifically, I lose debugger control when it returns fro the return JsonConvert.DeserializeObject<T>(result); line in "ApiClient.cs".

EDIT: This no longer affects my project as I am now running the CobinhoodClient in a separate thread to the Chart thread.

`
using System;
using Cobinhood.API.Csharp.Client;
using System.Windows.Forms.DataVisualization.Charting;

namespace ConsoleApp_Temp
{
class Program
{
static void Main(string[] args)
{
// Chart chart1 = new Chart(); // If this line is uncommented, then the call to 'GetSystemTime()' never returns.

        string apiKey = null;
        ApiClient apiClient = new ApiClient(apiKey);
        CobinhoodClient cobinhoodClient = new CobinhoodClient(apiClient);

        var systemTime = cobinhoodClient.GetSystemTime().Result;
        Console.WriteLine($"Time: {systemTime.Result.Time.ToString()}");
    }
}

}
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions