wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
996 stars 164 forks source link

Support for VB.NET: 'field' is ambiguous (case sensitivity) #152

Closed Tecnosoft-dev closed 1 year ago

Tecnosoft-dev commented 1 year ago

Because this language is not case sensitive for that an ambiguous exception denies the app to be compiled Please consider changing id and ID, so the they are not equal members name.

wiz0u commented 1 year ago

Sorry, WTelegramClient will NOT be modified to address this issue, so here are three solutions:

  1. Convert your project to C# 👍🏻
  2. Create a small C# wrapper library to access WTelegramClient, which you can then use in your VB․NET project
  3. Use Reflection to access the ambiguous fields/properties, like this:
    Dim propValue = obj.GetType().GetProperty("ID").GetValue(obj)
    Dim fieldValue = obj.GetType().GetField("id").GetValue(obj)