Error code 0x80040154 in debugging an UWP application with Visual Studio 2022, Windows on ARM
I am tryying to port an UWP application to Windows on ARM. The solution build without error, however, the application itself cannot be started.
With Visual Studio, the application is debugged and throws exception
System.Runtime.InteropServices.COMException:“Class not Registered (Exception from HRESULT: 0x80040154)”
The position on which the exception is where a class from external DLL is initialized
public static MessageSendOptions PreviewOnly = new(false, false, false, false, null, 0, true);
The class MessageSendOptions
is defined in an external DLL Telegram.Td.dll, which can be found and navigated to by Visual Studio. I tried to manual register this dll with regsvr32.exe .\Telegram.Td.dll
. However, RegSvr claims that this dll cannot be loaded since module cannot be found. I tried to use ldd
to examine the dependencies of this dll, which gives the following output
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ff9c4880000)
xtajit64.dll => /c/Windows/System32/xtajit64.dll (0x7ff9c0c50000)
KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ff9c4280000)
KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ff9bffe0000)
apphelp.dll => /c/Windows/SYSTEM32/apphelp.dll (0x7ff9bf870000)
msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ff9c3990000)
Telegram.Td.dll => /c/Users/oracl/Documents/Visual Studio 2022/Unigram-v10.8/Telegram/bin/ARM64/Release/AppX/Telegram.Td.dll (0x7ff8d3320000)
api-ms-win-core-com-l1-1-0.dll => not found
api-ms-win-core-synch-l1-1-0.dll => not found
api-ms-win-core-localization-l1-2-0.dll => not found
api-ms-win-core-handle-l1-1-0.dll => not found
api-ms-win-core-errorhandling-l1-1-0.dll => not found
api-ms-win-core-io-l1-1-0.dll => not found
api-ms-win-core-file-l1-1-0.dll => not found
api-ms-win-core-file-l1-2-0.dll => not found
api-ms-win-core-memory-l1-1-0.dll => not found
api-ms-win-core-libraryloader-l1-2-0.dll => not found
api-ms-win-core-file-l2-1-0.dll => not found
api-ms-win-core-synch-l1-2-0.dll => not found
api-ms-win-core-processthreads-l1-1-0.dll => not found
api-ms-win-core-processtopology-obsolete-l1-1-0.dll => not found
api-ms-win-core-profile-l1-1-0.dll => not found
api-ms-win-core-sysinfo-l1-1-0.dll => not found
api-ms-win-core-memory-l1-1-1.dll => not found
api-ms-win-core-string-l1-1-0.dll => not found
api-ms-win-core-timezone-l1-1-0.dll => not found
api-ms-win-core-heap-l1-1-0.dll => not found
api-ms-win-core-sysinfo-l1-2-0.dll => not found
api-ms-win-core-debug-l1-1-0.dll => not found
vccorlib140_app.DLL => not found
MSVCP140_APP.dll => not found
VCRUNTIME140_APP.dll => not found
api-ms-win-crt-runtime-l1-1-0.dll => not found
api-ms-win-crt-stdio-l1-1-0.dll => not found
api-ms-win-crt-heap-l1-1-0.dll => not found
api-ms-win-crt-time-l1-1-0.dll => not found
api-ms-win-crt-math-l1-1-0.dll => not found
api-ms-win-crt-convert-l1-1-0.dll => not found
api-ms-win-crt-string-l1-1-0.dll => not found
Normaliz.dll => /c/Windows/SYSTEM32/Normaliz.dll (?)
api-ms-win-core-winrt-string-l1-1-0.dll => not found
api-ms-win-core-util-l1-1-0.dll => not found
api-ms-win-core-interlocked-l1-1-0.dll => not found
This seems to be an UWP issue, since as decribed in here, the api-ms-win-core-*-l1-1-0.dll
are implemented by all Windows devices.
My questions are as follows:
- Is the 0x80040154 error introduced by missing dependencies of the Telegram.Td.dll, which makes it unable to be registered and loaded?
- If there are other reasons for 0x80040154 error, how can I further debug this issue.
The system setup is listed as follows
Microsoft Visual Studio Community 2022 Version 17.10.5
Microsoft .NET Framework Version 4.8.09032
Visual C++ 2022 00482-90000-00000-AA525
Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.10.344.38934
Windows 11 professional 10.0.22631