Closed aloji closed 4 years ago
I'm not aware how Azure works, sorry :( Could you check if the file is in actual file system on the server after deployment?
Yes, the file exists in the folder win-x64
And the TDLib.dll, TDLib.Api.dll files also exist
But I do not see the td.binlog
I will continue investigating :(
Oh, it could be not tdlibjson.dll
directly, but some of dependencies. In such cases, it could be hard to determine which one it couldn't found. Does Azure have RDP access? The easiest way to debug DLL dependency load failure is to fire up procmon.exe
.
Hi @ForNeVeR
I can not found in azure web app what is the problem. :/
Now, I'm try to deploying in a docker linux and logged this error.
fail: System.DllNotFoundException: Unable to load shared library 'tdjson' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libtdjson: cannot open shared object file: No such file or directory at TdLib.Bindings.LinuxBindings.td_json_client_create() at TdLib.TdJsonClient..ctor() at TdLib.TdClient..ctor()
Could you help me?
Regards
Hi
Is possible that only run in windows 10? because I run in win server 2016 and received the same error and run in other window 10 and working fine.
Regards
@aloji
Which Linux distribution do you use? tdlib.native is tested on Ubuntu x64. In case you have another distribution, then it depends whether it should work out-of-the-box or not.
Also, you could really try to set up LD_DEBUG
and debug the process of library search (I am not a Linux expert though, so I'm sorry but I've no additional info on how this work).
It is strange that it doesn't work on Windows Server 2016, but it is good that it fails on a non-cloud OS distrituition I could set up and check what it lacks of.
But, since already have a Win Server 2016 handy, could you please debug it with Process Monitor? You should start Process Monitor and set the filter for dotnet.exe
process (or whatever your process is called), and then reproduce your issue. Then you could attach the activity snapshot here if you don't want to read it yourself.
@ForNeVeR
Please, check the code in https://github.com/aloji/TelegramTdLib
For Windows OS
When I copy the files generated in debug folder and run in other machine (dotnet TelegramTdLib.dll), the app throw the exception:
System.DllNotFoundException: Unable to load DLL 'tdjson.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at TdLib.Bindings.WindowsBindings.td_set_log_verbosity_level(Int32 level)
I added <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
to enforce copying NuGet assemblies to the built output.
This are the log file filtered by process name dotnet.exe
The debug folder: debug.zip
Thank you for your help.
@aloji, thanks for additional information, I think I've found the issue: tdlib built with default settings requires Visual Studio 2015 redistributable (namely, MSVCP140.dll
) being installed on the target system.
For now, you could deal with it either by installing a redistributable package or packing this file together with your application.
In the meantime, I'll see what could be done to statically build this library with the binary, or require some runtime library version that is already installed by .NET Core distribution.
I have reported the issue to tdlib.native: https://github.com/ForNeVeR/tdlib.native/issues/29.
@ForNeVeR
I installed the redistributable package and now I can see the dll in system32 but the problem persist :/
The new logs after installed MSVCP140.dll
I'm sorry, I've been wrong earlier. Now it looks for vcruntime140_1.dll
which is part of the combined VS2015, 2017 and 2019 runtime. Please try that one.
Now is working... Thanks a lot.
Now is working... Thanks a lot.
Hi bro, I have met the same problem on ubuntu, It works fine on windows server after I install "combined VS2015, 2017 and 2019 runtime" . But how can I install it on ubuntu? It sames useless to just copy "vcruntime140_1.dll" in the floder , Thank you.
Ubuntu version doesn't depend on VC Runtime (since it's technically impossible). It depends on something else. For start, could you please share your .csproj
file?
Ubuntu version doesn't depend on VC Runtime (since it's technically impossible). It depends on something else. For start, could you please share your
.csproj
file?
Ok,here are my.csproj
file content:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Magick.NET-Q16-x64" Version="8.2.1" />
<PackageReference Include="Magick.NET.Core" Version="8.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="TDLib" Version="1.7.0" />
<PackageReference Include="TDLib.Api" Version="1.7.0" />
<PackageReference Include="Telegram.Bot" Version="16.0.2" />
</ItemGroup>
</Project>
Please try adding a tdlib.native package.
Please try adding a tdlib.native package.
Thanks bro, I forgot I have only compiled tdjson.dll
for windows , It works fine after install tdlib.native
.
Hi @ForNeVeR, @x2bool,
The app logged this error when deploying in Unity Android app. Any ideas?
The app is working fine in Unity Editor (Windows), but it doesn't work in Unity Android phone app.
2022-02-06 22:30:16.570 27342-27363/? E/Unity: DllNotFoundException: Unable to load DLL 'tdjson': The specified module could not be found.
at TdLib.Bindings.LinuxBindings.td_json_client_create () [0x00000] in <00000000000000000000000000000000>:0
at TdLib.TdJsonClient..ctor (TDLib.Bindings.ITdLibBindings bindings) [0x00000] in <00000000000000000000000000000000>:0
at TdLib.TdClient..ctor (TDLib.Bindings.ITdLibBindings bindings) [0x00000] in <00000000000000000000000000000000>:0
at Telegram.Chat.ChatPanel+
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
at Telegram.Chat.ChatPanel.telegramInit () [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
at System.Th
Ref : Unity : https://unity.com/
@taeyeonlee Can you suggest a solution? Installed https://github.com/GlitchEnzo/NuGetForUnity on Unity. Imported Tdlib.dll, Tdlib.Api.dll, tdjson.dll. It works fine on Windows. But from Android apk i have error: DllNotFoundException: tdjson.dll
I didn't find a way to use the Tdlib libraries for Android.
On Mon, Apr 4, 2022 at 1:09 AM Jeffy94 @.***> wrote:
@taeyeonlee https://github.com/taeyeonlee Can you suggest a solution? Installed https://github.com/GlitchEnzo/NuGetForUnity on Unity. Imported Tdlib.dll, Tdlib.Api.dll, tdjson.dll. It works fine on Windows. But from Android apk i have error: DllNotFoundException: tdjson.dll
— Reply to this email directly, view it on GitHub https://github.com/egramtel/tdsharp/issues/39#issuecomment-1086898944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUTYI5CM5S6VRNLZ62JI63DVDG7CJANCNFSM4K7XTFTQ . You are receiving this because you were mentioned.Message ID: @.***>
maybe there are other ways to integrate the Telegram API into Unity?
There was a problem when changing the version from .NET 7 to .NET 8
The error only appears when using Docker. The build file remains the same.
The error appears when creating a client: _client = new TdClient();
Package versions TDLib (1.8.21) TDLib.Api (1.8.21) tdlib.native(1.8.21)
libraries in the runtimes/linux-x64/native folder: libtdactor.a libtdapi.a libtdclient.a libtdcore.a libtddb.a libtdjson.so libtdjson.so.1.8.21 libtdjson_private.a libtdjson_static.a libtdnet.a libtdsqlite.a libtdutils.a
Question: Will the problem be solved somehow?
The error itself: Unable to load shared library 'tdjson' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: /app/bin/Debug/net8.0/runtimes/linux-x64/native/tdjson.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/tdjson.so: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/tdjson.so: cannot open shared object file: No such file or directory libssl.so.1.1: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/libtdjson.so: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/libtdjson.so: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/runtimes/linux-x64/native/tdjson: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/tdjson: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/tdjson: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/runtimes/linux-x64/native/libtdjson: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/libtdjson: cannot open shared object file: No such file or directory /app/bin/Debug/net8.0/libtdjson: cannot open shared object file: No such file or directory
Please open new reports on tdlib.native repo if you have problems with its packages.
You are free to provide your own implementation as well; tdsharp is not tied to tdlib.native.
Hi @ForNeVeR, @x2bool,
The app logged this error when deploying in azure web app service. Any ideas?
System.DllNotFoundException: Unable to load DLL 'tdjson.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at TdLib.Bindings.WindowsBindings.td_json_client_create() at TdLib.TdJsonClient..ctor() at TdLib.TdClient..ctor()
I can see the dll in the machine
The service is configured on 64 bit
Regards,