locked
The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception RRS feed

  • Question

  • User-426119323 posted

    We are using asp.net mvc application to connecte SAP Hana database ussing Sap.Data.Hana.v4.5 dll version Version=2.4.171.0. This dll available on the system where we installed sap b1 client. 

    We are getting error at below line:

    HanaConnection conn = new HanaConnection();

    Could you please help us what causing this issue.

    The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception

    The specified module could not be found
    Sap.Data.Hana.v4.5

       at Sap.Data.Hana.HanaUnmanagedDll.LoadDll(String dllPath)
       at Sap.Data.Hana.HanaUnmanagedDll..ctor()
       at Sap.Data.Hana.HanaUnmanagedDll.get_Instance()
       at Sap.Data.Hana.HanaConnection..cctor()

    Friday, August 28, 2020 9:20 AM

Answers

  • User-821857111 posted

    The specified module could not be found
    The error message says that the dll could not be found. You should double check that it is actually available on the machine where the MVC application is running.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 2, 2020 1:34 PM

All replies

  • User-821857111 posted

    The specified module could not be found
    The error message says that the dll could not be found. You should double check that it is actually available on the machine where the MVC application is running.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 2, 2020 1:34 PM
  • User-426119323 posted

    Thanks you. Now I am able solve this issue. I am to run the dll through iis worker process also able to debug the solution by hosting the app in iis. Seems iis express causing this issue. The same dll works fine in console application.

    Thursday, September 10, 2020 5:33 AM