Is a COMException of 0x80040154 always 'Class not registered'?

后端 未结 3 1764
悲哀的现实
悲哀的现实 2021-01-13 11:58

Does a System.Runtime.InteropServices.COMException of 0x80040154 always mean that the class isn\'t registered? I\'m getting a COMException which says \"Retrieving the COM c

3条回答
  •  深忆病人
    2021-01-13 12:33

    I had the same problem trying to build and run a .NET application on Windows 7 x64 that called interop.domino.dll, which is 32 bit only.

    To resolve, I recompiled the .NET application to run specifically as x86 when run on x64 operating systems.

    I was using Visual Studio 2010 Express Edition which is trickier to target specifically for x86 platforms than the paid for versions.

    The solution was:

    1. Click TOOLS > OPTIONS > PROJECTS AND SOLUTIONS
    2. Check the box "Show advanced build configurations" and click OK
    3. Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager
    4. Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE
    5. Now rebuild the project

提交回复
热议问题