1

I am using linq2db as ORM for my web application project (ASP.NET Core 2.2) with SAP HANA database.

When I run my code including database queries I receive the following error (first 2 rows):

System.IO.FileNotFoundException: Could not load file or assembly 'Sap.Data.Hana, Culture=neutral, PublicKeyToken=null'.
File name: 'Sap.Data.Hana, Culture=neutral, PublicKeyToken=null'

I assumed that Sap.Data.Hana refers to the assembly SAP HANA provides in their data provider package. That's why I established a reference to the assembly Sap.Data.Hana.v4.5.dll using Visual Studio UI. However, I still receive the same error.

What could be the reason for this error? Am I using the wrong assembly file or do I have to establish the reference differently?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Manderhub
  • 25
  • 1
  • 7

3 Answers3

1

SAP have added support for .net core from HANA 2.0 SPS4: SAP HANA Client Interface Programming Reference for SAP HANA Platform

Also see SAP Note 2499500.

Daz
  • 2,833
  • 2
  • 23
  • 30
  • 1
    Great! Finally they noticed .net core at least for HANA. We will add support in next linq2db version –  May 24 '19 at 07:01
  • It seems it works only on Windows: "The driver is Sap.Data.Hana.Core.v2.1.dll and it only runs on Microsoft Windows." – Vitaliy Fedorchenko Sep 20 '19 at 13:22
0

If I understand you correctly, you try to use SAP HANA provider from .net core application. Unfortunatelly SAP doesn't have HANA provider for .net core, only for .net framework.

  • also check this question, maybe it will help somehow: https://stackoverflow.com/questions/41498542/net-connector-for-sap-hana-with-net-core –  Mar 14 '19 at 09:15
  • Thanks for your reply! Yes, that's correct. I try to use SAP HANA provider for .net core application. Oh, I see. Is there a workaround for this issue? – Manderhub Mar 14 '19 at 09:18
  • Thanks, I'll try to follow instructions in your linked question and create my own nuget package with the dll inside. – Manderhub Mar 14 '19 at 09:20
0

Configure your Project to run on x64.