sochix / TLSharp

Telegram client library implemented in C#
1.01k stars 380 forks source link

ConnectAsync() #941

Open VictorShap opened 4 years ago

VictorShap commented 4 years ago

ConnectAsync() doesn't work, when program starts doing this method, program stops, but isConnected() returns true My code : using System; using System.Threading.Tasks; using TLSharp.Core;

    namespace ConsoleApp1
    {
        class Program
        {
            private const int apiId = ;
            private const string apiHash = "";
            private const string phoneNumber = "";
            static void Main(String[] args)
            {

                RunClient();
            }
            public static async void RunClient()
            {

                var client = new TelegramClient(apiId, apiHash);
                await client.ConnectAsync();           
                var hash = await client.SendCodeRequestAsync(phoneNumber);

            }
        }
    } 
knocte commented 4 years ago

@VictorShap hey Victor, we believe we have fixed this in this PR: https://github.com/nblockchain/TgSharp/pull/7 can you try it?

VictorShap commented 4 years ago

@knocte yeah, I saw it, but how can test it? You mean add those changes in library by myself ?

VictorShap commented 4 years ago

If it’s important, I’ve installed this library via NuGet

VictorShap commented 4 years ago

@knocte I have added TGSharp package, and nothing changes

knocte commented 4 years ago

@VictorShap what version did you use?

VictorShap commented 4 years ago

@knocte I use 0.1.0.555 version of TLSharp and 0.1.0.554 of TGSharp

knocte commented 4 years ago

@VictorShap that version of TgSharp doesn't have the change that possibly fixes this, upgrade to the latest pre-release please.

VictorShap commented 4 years ago

@knocte I’ve installed 0.1.0.506 version of TGSharp, but nothing changes, my program stops at ConnectAsync()

knocte commented 4 years ago

0.1.0.506 is even older version than 0.1.0.554, I'm telling you to install a version that starts with "0.1.1"

VictorShap commented 4 years ago

@knocte I can’t do it, because 0.1.0.554 is the latest in NuGet( I can install only 2 version this and 0.1.0.506) You mean clone it from GitHub?

knocte commented 4 years ago

No, I don't mean clone from github. You need to enable pre-release checkbox when upgrading, then you will see the latest versions of TgSharp.

knocte commented 4 years ago

@VictorShap I just googled about it and this is the first result: https://docs.microsoft.com/en-us/nuget/create-packages/prerelease-packages#installing-and-updating-pre-release-packages

VictorShap commented 4 years ago

I have done it, now I have System.IO.FileNotFoundException “Could not load file or assembly TeleSharp.Tl version 1.0.0.0, culture =neutral , PublicKeyToken =null on ConnectAsync()

knocte commented 4 years ago

Please open a new issue with the full ex.ToString() in TgSharp repo

VictorShap commented 4 years ago

I have installed the latest pre-release version

VictorShap commented 4 years ago

Okay