Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Connector for SAP HANA with .Net Core

We are creating a web api for our organization. API connects and retrieves data from a HANA View. I am referring the sample provided at the below link to establish the connectivity

https://blogs.sap.com/2015/04/15/creating-a-c-application-using-sap-hana-and-adonet/

Since .Net Core does not allow DLL to be referenced directly, we are creating a local nuget package and referencing the same (https://docs.nuget.org/ndocs/create-packages/creating-a-package)

I get the below error when I initialize HanaConection:

{"Version mismatch: C:\Windows\assembly\GAC_MSIL\Sap.Data.Hana.v3.5\1.0.120.0__0326b8ea63db4bc4\Sap.Data.Hana.v3.5.dll (1.0.120.0), C:\Program Files\sap\hdbclient\libSQLDBCHDB.dll (1.00.112.00.1457615240).":"C:\Program Files\sap\hdbclient\libSQLDBCHDB.dll"}

like image 945
IamChandu Avatar asked Jan 06 '17 03:01

IamChandu


2 Answers

Looks like your assembly expects a HANA rev. 120 driver, while a rev. 112 driver is actually installed.

like image 155
Lars Br. Avatar answered Nov 17 '22 18:11

Lars Br.


We had created the local nuget Package using x86 version of SAP .Net connector, our app was running on 64bit mode. Hence it was failing. I recreated the package using 64bit version of dll and the problem got resolved.

like image 37
IamChandu Avatar answered Nov 17 '22 18:11

IamChandu