Failed –Retrieving the COM class factory for component with CLSID ….


When you run the .net Code in X64 Environment you will get the following error message.

” Failed –Retrieving the COM class factory for component with CLSID ….”

E.g. in CMS Export / Import server side .net code = “ExportSiteContentIncremental(…) Failed –Retrieving the COM class factory for component with CLSID {CA0752B3-021C-4F99-82E3-2C0F19C5E953} failed due to the following error: 80040154.”


The possible workaround is modify your project’s platform from ‘Any CPU’ to ‘X86’ (in Project’s Properties, Build/Platform’s Target)


The VSS Interop is a managed assembly using 32-bit Framework and the dll contains a 32-bit COM object. If you run this COM dll in 64 bit environment, you will get the error message.

Comments (14)

  1. L’altro giorno ho pagato le spese di un problema legato all’istanziazione di componenti COM, via COM-Interop,…

  2. mjda says:

    Is there a workaround for an ASP.NET project calling the COM component?

  3. prafullparijat says:

    Hi is there any way to call the COM object therough some other method?

  4. mrsiva says:

    Thanks Karthi.

    This article helped me. I was running behind this problem for about a week.

    Is there a way this can be applied on ASP.Net application?

    I get the following error when I target it for x86 and use in

    System.BadImageFormatException: Could not load file or assembly ‘MyClassLibrary’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

    WRN: Assembly binding logging is turned OFF.

    To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.

    Note: There is some performance penalty associated with assembly bind failure logging.

    To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

  5. Lars Harbo says:


    I had the same error when trying to communicate with an agilent 34980A DMM instrument and I could not figure out why the sample code using VISA (text string based) interface worked and the Interop interface did not.

    Sure enough Any CPU changed to X86 did the trick.

    Thanks a bundle…

  6. Karl says:

    I'm having the same issue now, but all my target builds are already set to x86. Its a Visual Studio 2010 winforms app which uses a third party dll. This dll has been added to the setup as an assembly and I've tried both "vsdraCOMRelativePath" and "vsdraDoNotRegister" with no luck, but I may be barking up the wrong tree!

  7. Cedric dsouza says:

    Thanks for the info. Was struggling on this for many days

  8. Shuoxiao says:

    Hi Can anyone can tell me how to "modify your project's platform from 'Any CPU' to 'X86' (in Project's Properties, Build/Platform's Target)".

    I am trying to install perkin elmer solftware on my Win 7, 64-bit operation system. I always received the same issue. The software can open by itself but it shows the error "Retrieving the COM class factory for component with CLSID {AC5D2562-804E-11D0-88F2-0020AFC9A5CC} failed due to the following error: 8007045a".

    Can you please let me know where I can found the project's platform and so what you said change "any CPU" to "X86"?

    thank you so much!

  9. Karl says:

    Excellent! Our dev had been struggling with this for months

Skip to main content