views:

211

answers:

2

I am trying to call LoadLibrary and load Delphi dll in ASP.NET application. On my production machine everything works fine (using VS integrated server), but when I place it on destination server, LoadLibrary returns IntPtr.Zero. File.Exists(libraryName) returns true. What can be the problem?

+1  A: 

most likely that delphi dll has an external dependency. if it were me, i'd write a small delphi app to load the library implicitly. when you run that helper app on the destination machine, you should get an error message on the screen that gives you the name of the missing external library.

Don Dickinson
You are right. I had all necessary dependencies in the same directory, but it still didn't find it there. Extending %PATH% variable solved the problem. Thanks!
LukLed
A: 

Did you copy the delphi dll and its supporting DLL's onto the target machine, somewhere in the directory where the ASP.NET application is running off against?

Hope this helps, Best regards, Tom.

tommieb75
No. I didn't have it in the same directory, but there was no problem with accessibility.
LukLed