aspnet application unable to load unmanaged dll in windows10/iis10

0

I have a pair of aspnet C# applications that call an unmanaged dll (written in Delphi). The applications are installed on IIS. When any of the two applications tries to call the unmanaged dll the following error is reported (same error in both cases):

"Unable to load DLL 'dllName.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)"

Here are some details about the applications:

  • just to be clear: the web applications are completely independent: each one is installed separately on the iis server each one with his own copy of the unmanaged dll.
  • the applications are installed on iis using microsoft web setup project.
  • VS version: VS2015
  • error only occurs with windows 10/iis 10
  • aspnet applications written in C# using dotnet v4.0
  • one application is written in aspnet webforms framework, the other is written in aspnet MVC4 framework.
  • the applications have been compiled with the 'any cpu' option
  • the unmanaged dll was compiled with a 32bit Delphi compiler
  • these applications work correctly on other windows versions (verified ws2008, ws2012, win7, win8, ws2003, winvista)
  • both applications throw the same error when calling the unmanaged dll.
  • the application pool used to run the applications has the option 'enable 32 bit applications' enabled (this is required because of the unmanaged dll compiled with a 32bit compiler)
  • already tried to compile the applications using 'x86' option in Visual studio. still got the error.

Any ideas about how to debug this problem or a possible solution? thanks!

c#
asp.net
delphi
iis
dll
asked on Stack Overflow Feb 25, 2016 by DanielC

1 Answer

0

The prerequisites to running a 32 bits delphi DLL in IIS are:

Enable 32Bits Application In the site AppPOOL, like bellow in image. enter image description here

Your c# project need compile to x86 Plataform

And what finally solved my problem is copying borlndmm.dll in the application bin directory along with all the other C # project DLLs

answered on Stack Overflow Dec 6, 2019 by Rodrigo Zimmermann

User contributions licensed under CC BY-SA 3.0