How to fix UPDATE_APP_TO_LOGIN error in TLSharp C#

2.1k views Asked by At

Hi i am using TLSharp latest version is 0.1.0.574 and when i call var hash = await client.SendCodeRequestAsync("<my_phone>"); i got error System.InvalidOperationException: 'UPDATE_APP_TO_LOGIN' anyone know how to fix it

My code

TelegramClient client = new TelegramClient(appid, "apihash",null,"session",null,DataCenterIPVersion.OnlyIPv4);
await client.ConnectAsync();
var hash = await client.SendCodeRequestAsync("<my_phone>");
string code = "";
await client.SignUpAsync("<my_phone>", hash, code, "<fist_name>", "last_name");
1

There are 1 answers

0
Wizou On BEST ANSWER

The error "UPDATE_APP_TO_LOGIN" happens because your Telegram Client/Library uses an obsolete API layer.

As stated on its project page, TLSharp is no longer maintained and will not be updated to fix this.

You should switch to WTelegramClient which is:

  • offering up-to-date API (latest layer)
  • safer (latest MTProto v2 implementation and many security checks)
  • feature-complete (covers all API methods, handling of updates, multiple-DC connections)
  • easy-to-use (API calls are direct methods with fully documented parameters in VS)
  • designed for .NET 5.0+, but also available for .NET Standard 2.0 (.NET Framework 4.6.1+ & .NET Core 2.0+)

Available on Nuget. ReadMe/Github is here.