问题
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"}
回答1:
Looks like your assembly expects a HANA rev. 120 driver, while a rev. 112 driver is actually installed.
回答2:
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.
来源:https://stackoverflow.com/questions/41498542/net-connector-for-sap-hana-with-net-core