Catastrophic failure on IIS Web Service when calli

2019-08-11 14:35发布

问题:

Maybe the worst type of error message that one can see. Does not mean anything, may be related to everything...

I try to create a web service (WS) on IIS 7.5 (I have initially tried WCF services but same story) The WS uses a COM DLL which is successfully registered and the COM security permissions are given.

When I run the WS using Visual Studio Development Server everything is fine, I get the results as requested. But when I try to deploy the WS to IIS, I end up with

System.Runtime.InteropServices.COMException: Catastrophic failure

My computer has Windows Server 2008 R2 Standard, x64. I have to emphasize: I develop (using Visual Studio 2010 Ultimate), test (using Visual Studio Development Server) and deploy (using IIS 7.5) on the same computer.

I was thinking that the problem might be related to 32-64 bit incompatibilities, as my COM is supporting 32 bits. Therefore, I changed the application pool settings to enable 32 bit applications, changed the platform target to x86 in Visual Studio, redeployed the WS, none of these helped.

My question is:

How can a WS successfully run on VS Development Server but fail on IIS? What else shall I change in IIS settings?

回答1:

It really helps to consult the producer of the COM DLL. They have given a clear installation procedure for the DLL, that I have somehow omitted.

Moral of the story: Although your web service or web site operates successfully under Visual Studio Development Server, this does not necessarily mean that you have configured all settings for the COM DLL correctly.

You can start checking the following issues:

  • Register the COM DLL
  • Check configuration settings using dcomcnfg
  • If your DLL does not appear in dcomcnfg lists, then probably you did not register it correctly. Some registry editor entries are probably missing.
  • Check your IIS application pool settings
  • You may need to impersonate in web.config
  • Check the event viewer. It might include some important clues

In my case, I was playing with all of these items, but never in the correct sequence. Finally the help from the producer has arrived which was showing the correct path.