tags:

views:

264

answers:

2

Using OLE/COM Viewer I get the following error (when expanding my registered class)

CoGetClassObject failed.
<No system message defined> severity: SEVERITY_ERROR, facility:
<Unknown Facility> ($80131522)

The COM Class is a C# class registered with RegAsm.

What does this error mean?

Edit:

See http://www.dotnet247.com/247reference/msgs/24/124704.aspx for similar issue.

+1  A: 

Is there a dependent assembly missing from the bin folder of the COM Registered assembly? Or a dependent assembly that supposed to be in the GAC that isn't actually in the GAC?

You may also be able to resolve you're issue using /codebase switch which will add a registry entry pointing to the location of your assembly.

You might also be able to find out more using fuslogvw to see what's happening when your .NET assemblies are being bound to by OLE Viewer.

Michael Prewecki
My assembly contains a factory class (the only class that is COM visible). The factory class produces a different implementation of a common interface depending on whether Sharepoint 2003 or Sharepoint 2007 is installed. Your answer above is making me think that maybe the problem is that normally, either SP2003 is installed OR SP2007, which means that the SP assemblies referenced by my assembly is not always present... Does this sound like a possible cause? Thanks for the pointer.
Ries
Yeah, that could be the case, i'm not exactly sure if OLE Viewer would cause you assembly and it's dependent assemblies to be loaded under it's process space. fuslogvw will almost certainly tell you if your idea is correct by pointing out the exact binding failure.
Michael Prewecki
A: 

Found the problem:

By looking at the fuslogvw logs I learned that OleViewer looks for any assembly in the same folder as OleViewer.exe that matches the assembly it is looking for (!). By chance I had an old version of my assembly in the folder I was running OleViewer from. So what I had to do was to copy OleViewer.exe to the folder where my assembly was registered. Strange but true!

Ries