Retrieving the COM class factory for a component failed

S

Sakke

Hello!

We have written a GCryptoSvr.dll COM server in C++. Inside that resides
WebClient COM component. WebClient CLSID is
{8DC27D48-F94C-434B-A509-C3E1A3E75B9E}. When we are using that WebClient
COM component from C++ code it works just fine. However when we try to
use that same WebClient in the same machine with following C# code:

using GCRYPTOSVRLib;
WEBClient WC = new WEBClient();

we get error:

Server Error in '/SesamWeb' Application.
--------------------------------------------------------------------------------

Retrieving the COM class factory for component with CLSID
{8DC27D48-F94C-434B-A509-C3E1A3E75B9E} failed due to the following
error: 800700b6.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Retrieving the COM
class factory for component with CLSID
{8DC27D48-F94C-434B-A509-C3E1A3E75B9E} failed due to the following
error: 800700b6.

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:


[BadImageFormatException: Retrieving the COM class factory for component
with CLSID {8DC27D48-F94C-434B-A509-C3E1A3E75B9E} failed due to the
following error: 800700b6.]
GetDynamicReport.GetDynamicReportHandler.SendXml(String xml, String
sessionId, String modifierString) +36

Parameters.ParameterHandler.InitializeBidProducts(HttpApplicationState
sesamApplication) +515

Parameters.ParameterHandler.InitializeSesamWebParameters(HttpApplicationState
sesamApplication) +52
ASP.global_asax.Application_Start(Object sender, EventArgs e) +11

Further it seems that this error occurs only in machines with Windows
2003 Server operating system.
We have tested this in several windows xp pro-operating systems and in
them everything seems to work just fine.
Then we have tried this in 2 machines with Windows 2003 Server operating
system and in both the error described above occurs.

Even in machines with Windows 2003 Server the WebClient works from c++
code but not from C#.
So it seems that the problem is between the interop between C# code and
COM-component.

Any suggestions???
 
D

dave

I am experiencing the same problem. I have a PeopleSoft Component
Interface com object that is registered on the server and work fine
with a windows app but not with ASP.net. I had this com object working
in asp.net 1.1 by registering it in the bin folder of the asp.net app
on the server. This no longer works in 2.0. On my development box (win
xp pro ) if i run the asp.net app through the new .net development
server it works when I switch it to run under IIS I get the same error
you are getting. We have run out of guesses here. I am hoping some one
will reply.

Thanks
Lost in COM hell
 
P

Peter Huang [MSFT]

Hi Sakke,

From you description, I understand that you have a COM DLL(have you
registered it into COM+?), you will use it in a ASP.NET application. It
works in both C++ and C# on Windows XP, but on Windows 2003, it works in
C++ but not in C# application.
If I misunderstood, please feel free to let me know.

Here I assume that the C++ program are an Windows(Console) Application.
Because Windows XP will run IIS 5.1 while Windows 2003 run IIS 6.0 which
will affect the ASP.NET application's behavior.

As Dave said, I think you may try to isolate the problem by calling the COM
from a C# windows application with the same code to see if that works.
If yes, to some extent we can make sure the different IIS behavior caused
the problem.

Please take a look at the link below to run the application under certain
account(we can test with a powerful account)
306158 How to implement impersonation in an ASP.NET application
http://support.microsoft.com/default.aspx?scid=kb;EN-US;306158

You may have a try and let me know the result.
If you still have any concern, please feel free to let me know.
I look forward to hearing from you.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top