views:

1881

answers:

4

My assemblies that wrap a third-party DLL work fine in my windows test harness app, and they also work fine in a web service when spawned in debug mode (VS 2008 Visual Studio Development Server)! However, the app always crashes when running in the local IIS 7 web server. Here is the crash detail from the event log when running on the local IIS server:

Faulting application w3wp.exe, version 7.0.6001.18000, time stamp 0x47919413, faulting module ntdll.dll, version 6.0.6001.18000, time stamp 0x4791a783, exception code 0xc0000374, fault offset 0x000aada3, process id 0x990, application start time 0x01c9b4133281d5d0.

Discussion: I wrote a wrapper around a .NET dll from a third-party (LinkPointTransaction.dll from FirstData), and I wrote some other assemblies that reference that wrapper. As the code is running, a call to the third-party LinkPointTransaction.LinkPointTxn.Send() sends the transaction successfully to FirstData over the internet, but my application crashes w3wp.exe somewhere during that call, before it hits the next line. It does not throw a managed exception that I can see; it just crashes. Works fine everywhere on my machine except in IIS7.

I am running 64bit Vista Home Premium (IIS7), but I enabled 32bit apps in IIS, created a separate AppPool just for this web service, and have forced all of my assemblies to x86. I have tried running the App Pool under my user account with Admin privileges instead of as the Network Service. UAC is turned off. I have tried Integrated and Classic modes. I have explicitly opened the TCP/IP port in my local firewall that the LinkPointTransaction.dll uses to communicate with FirstData. I even have shut my firewall off (behind a router).

With any of these workarounds that I listed, it always works in a Windows app and also in a web service inside the VS Development Server, but never works in the local IIS server.

The AppPool for the IIS website is in Classic mode. (In response to Gidon)

A: 

How is the website configured in IIS7? If it is running in Integrated Mode switch to Classic Mode. See Breaking Changes for ASP.NET 2.0 applications running in Integrated mode on IIS 7.0

Gidon
The AppPool that the website is using is running in Classic mode.
Scott Fletcher
Did you also check the other migration errors in the link? such as the new place for httphandlers and modules in the web.config?
Gidon
+2  A: 

I don't think this is a programming question anymore, so I am 'answering' it.

Using WinDbg, I have tracked it down to the dll provided by the vendor. When the app crashes, it looks like a problem with the way the dll is de-allocating memory. The call stack shows a memory free operation in the dll, then a "heap free" operation in the kernel, then a "free heap" operation in ntdll, and a subsequent "report heap failure" (and then RtlReportCriticalFailure) that tears down the whole thing.

I still don't understand why it works in a Windows Forms app and in IIS 6, but not work in IIS 7. However, this has become more of a platform question than a 'programming' question. Besides, it is probably the vendor's responsibility to fix it rather than mine to work around it.

UPDATE: Within two days of filing the tech support ticket with the vendor, they provided an updated set of the integration DLLs that use a COM object that you register with regsvr32, and it works in IIS7 64-bit if you register it in the WOW64 directory. YEA FOR FIRST DATA TECHNICAL SUPPORT!

Scott Fletcher
I've talked with the technical support and got a hold of the updated DLLs. It works most of the time, but every once in a while, once a day or so, it "hangs." We start getting COM related error messages. Usually recycling the application pool fixes the problem, but needless to say this is not a solution. Is it working OK for you? Thanks.
pbz
P.S. Sometimes restarting IIS7 (64 bit) is required, recycling the application pool won't do it.
pbz
We have since changed merchant gateway companies. We use USAePay now.
Scott Fletcher
A: 

i have the same problem can you send me the files amir.magdy (at) gmail (dot) com

bo2bo2
Like pbz said in July, if you send an email to apisupport [at] linkpoint.com they'll send it to you. He is still having some trouble with it. Please check his notes in the accepted answer.
Scott Fletcher
A: 

how do i get these updated files?

bo2bo2