By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,537 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,537 IT Pros & Developers. It's quick & easy.

Retrieving the COM class factory for a component failed

P: n/a

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(S tring xml, String
sessionId, String modifierString) +36

Parameters.ParameterHandler.InitializeBidProducts( HttpApplicationState
sesamApplication) +515

Parameters.ParameterHandler.InitializeSesamWebPara meters(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???

Apr 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Apr 13 '06 #2

P: n/a
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...b;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.

Apr 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more C# / C Sharp Questions on Bytes