2024 Apr 01 9:08 PM
Reproduction steps
1)Created new Web API project in Visual studio 2022 and using Target Framework .NET 8.0, Platform target is Any CPU
2)Added package through NuGet is SAPHanaForNetCore 3.1.0 package
3)deploying the project on Azure app service and OS is Linux and getting below error 2024-04-01T14:35:07.4105784Z ---> System.DllNotFoundException: Unable to load shared library '/home/site/wwwroot/libadonetHDB.dll' 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: /home/site/wwwroot/libadonetHDB.dll: invalid ELF header at System.Runtime.InteropServices.NativeLibrary.Load(String libraryPath)
Description
Unable to load shared library '/home/site/wwwroot/libadonetHDB.dll' 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: I am using Visual Studio 2022 and Architecture is "Any CPU" I have downloaded the SAPHanaForNetCore 3.1.0 package through nuget
2024 Apr 01 9:27 PM
See if this helps you:
https://developers.sap.com/tutorials/hana-clients-dot-net-core.html
2024 Apr 02 10:24 PM
Hi Team,
I have gone through link but I didn't found the file libadonetHDB.so , could you please provide me the file?
2024 Apr 06 9:08 PM
The direct download link is https://tools.hana.ondemand.com/additional/hanaclient-dotnetcore-2.19.21-linux-x64.tar.gz. You can reach this link from https://tools.hana.ondemand.com/#hanatools.
Hope that helps,
Dan
2024 Apr 08 6:04 AM
Thank You @dan
I will try to add this libadonetHDB.so file on Linux App Service and will check if the code is working or not for .NET core application.
2024 May 15 7:35 PM
2024 May 15 7:52 PM
You can download the HANA Client from https://tools.hana.ondemand.com/#hanatools
Specifically the .NET driver for Linux can be found at
https://tools.hana.ondemand.com/additional/hanaclient-dotnetcore-latest-linux-x64.tar.gz
2024 May 15 8:34 PM
I downloaded the Linux.tar.gz, but I can't find the file inside.
2024 May 15 9:36 PM
This is what I see after downloading from https://tools.hana.ondemand.com/additional/hanaclient-dotnetcore-latest-linux-x64.tar.gz
2024 May 16 7:54 AM
Thank you for the link, I haven't found it on the site tools.hana.ondemand.com.
I have copied the file to my output directory, but the Entity Frameworks stucks, when i open the connection. Last message ist "Creating DbConnection".
2024 May 16 8:07 AM
2024 May 16 1:46 PM
Have you tried using the .NET SDK and the steps described at https://developers.sap.com/tutorials/hana-clients-dot-net-core.html ? Note that the steps are slightly different depending on the platform you are on Windows vs Linux as is the download link from https://tools.hana.ondemand.com/#hanatools as you will need the appropriate client for Windows, macOS, or Linux.
2024 May 17 7:25 AM
Yes I tried the steps. But after hdbclient installation there is no libadonetHDB.so file in the installation dir. And I'am not sure if I need the file. I use .Net 7 with Entity Framework. So in my project i reference Sap.EntityFrameworkCore.Hana.v7.0.dll and Sap.Data.Hana.Net.v6.0.dll. The Sap.Data.Hana.Net.v6.0.dll reference lidadonetHDB.dll and not libadonetHDB.so. Under windows this constellation works, but under linux i get the error "/app/libadonetHDB.dll: invalid ELF header".
2024 May 17 12:57 PM
If you are using an installation of the SAP HANA Client on Linux, make sure you are using the very latest version which is 2.20.22 released May 15th.
There was a known issue as described at
https://me.sap.com/notes/3427733
Client Installer changes
2024 May 17 1:10 PM - edited 2024 May 17 1:11 PM
I can't find the version 2.20.22 on https://tools.hana.ondemand.com/#hanatools
2024 May 17 1:19 PM
You can find 2.20.22 at the SAP Software Downloads site. This is further described in step 3 of https://developers.sap.com/tutorials/hana-clients-install.html#712a293b-6097-481d-b073-2425513695c0
2024 May 17 1:50 PM