2

I develop .Net Com Class Library on 32-bit Windows XP and when port it to 64-bit Windows-Server 2008 client code

 var t = Type.GetTypeFromProgID("ProgID");
 var a = Activator.CreateInstance(t);

failed with error mentioned in my question subject There was similar discussion Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I double checked the platform target (Project Properties / Build / Platform Target) I build my com .net assembly for -- it's x86

But the problem still present on 64-bit Win2008 Server...

What shall I check?

Community
  • 1
  • 1
Andrew Florko
  • 7,672
  • 10
  • 60
  • 107
  • The error is "Class not registered" which indicates the ProgID you're asking for does not exist on the machine. What is the ProgID? Is the software which provides that component installed? If it is an in-process object (i.e. in a DLL not an EXE), is the 32-bit version of it installed? (If not, try setting your build target to x64 to see if you can pick up the 64-bit DLL.) – Leo Davidson Dec 16 '10 at 09:40
  • Sorry, @Leo, the error is not "Class not registered", it's "Retrieving com class factory failed". I can observe my progId and CLSID in "Wow6432Node" registry section on Windows2008 server. – Andrew Florko Dec 16 '10 at 09:45
  • 80040154 definitely means "class not registered" ( http://leo.kelbv.com/wc134_errlook.png ). It's possible something is returning that error value incorrectly (or when a more specific value doesn't exist), or that it's some *other* class that was needed somewhere but wasn't registered. – Leo Davidson Dec 16 '10 at 12:47
  • Where does the code you've given from your question reside? Is that code, which is calling the COM class, _also_ set for platform target x86? – Mike Guthrie Mar 08 '12 at 18:54

0 Answers0