1
votes

I'm calling unmanaged dll in my web applicatrion and its works fine but if I run the web application in IIS its crashes when calling dll function. I cant catch the exception there its only ie error message "page cannot be displayed" and in event viewer there is an error:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7a5f8
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7ba58
Exception code: 0x4000001f
Fault offset: 0x000ce625
Faulting process id: 0x2084
Faulting application start time: 0x01cc9eb290740fe8
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: e0fc374f-0aa5-11e1-88bd-00224d5137ef

IIS settings: Enable 32-bit applications: True Managed Pipeline Mode: Integraded Identity: LocalSerice (tried every option)

I'm working on Windows 7 and C# VS2010 Framework 4.0

1
need more information, what is the functionality of your external dll? what do you mean it works in web but not in server? when developing against this dll are you able to run and test it against all scenarios in the same machine?user474407
Try creating a STA thread and communicating with managed dll through it. Check this article.Nikola Radosavljević
This DLL developed in Delphi 6 and its decrypting strings. When I'm running web project under visual studio web server its works but under IIS its crashes.user1021871
This is happening to me with shapelib and I can't get it figured out... shapelib.maptools.org Did you ever solve it?jocull

1 Answers

2
votes

try this,

wrap the function call with

try {
   // Call your delphi dll function here
} catch {
   Console.WriteLine("error");
}

Now set a breakpoint on the Console.WriteLine part.

Debug your application by making the Visual Studio to run the application through IIS (not the VS development webserver).

When you have hit your breakpoint inside the catch block, goto the Watch Window and check what is stored in the $exception variable.

This could give you more clues.