如何修复收到COMException错误的80040154?错误、COMException

2023-09-02 21:26:14 作者:柠夏ペ

移动工作的C#项目从64位Windows 7机32位XP的机器引起以下错误:

Moving a working C# project from a 64 bit windows 7 machine to a 32 bit XP machine caused the following error:

检索COM类工厂组件具有CLSID   {681EF637-F129-4AE9-94BB-618937E3F6B6}失败,原因是以下   错误:80040154

Retrieving the COM class factory for component with CLSID {681EF637-F129-4AE9-94BB-618937E3F6B6} failed due to the following error: 80040154.

681EF637-F129-4AE9-94BB-618937E3F6B6不是那么它安装不正确的注册表,但是这是为previously在64位的Windows 7机器的问题相同的ID。要解决这个错误在64位的Windows 7机器找到here (更改目标平台的x86),但是这并没有解决问题的32位XP的机器。我如何找到681EF637-F129-4AE9-94BB-618937E3F6B6,或者,相关的DLL甚至更好,我该如何修复此例外?

681EF637-F129-4AE9-94BB-618937E3F6B6 is not in the registry so it is not properly installed, but this is same ID that was previously a problem on the 64 bit windows 7 machine. The solution to this error on the 64 bit windows 7 machine was found here (change Platform Target to x86) but this does not solve the problem on the 32 bit XP machine. How do I find the dll associated with 681EF637-F129-4AE9-94BB-618937E3F6B6, or, even better, how do I repair this exception?

推荐答案

要查找DLL,去你的64位计算机,然后打开注册表。找到所谓的关键 HKEY_CLASSES_ROOT CLSID {681EF637-F129-4AE9-94BB-618937E3F6B6} InprocServer32的。该密钥将有DLL作为其默认值的文件名。

To find the DLL, go to your 64-bit machine and open the registry. Find the key called HKEY_CLASSES_ROOTCLSID{681EF637-F129-4AE9-94BB-618937E3F6B6}InprocServer32. This key will have the filename of the DLL as its default value.

如果您通过重新编译你的项目为86解决您的64位计算机上的问题,那么你就需要查看注册表的32位部分,而不是在正常的地方。这是HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{681EF637-F129-4AE9-94BB-618937E3F6B6}InprocServer32.

If you solved the problem on your 64-bit machine by recompiling your project for x86, then you'll need to look in the 32-bit portion of the registry instead of in the normal place. This is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{681EF637-F129-4AE9-94BB-618937E3F6B6}InprocServer32.

如果该DLL是专为32位,那么你可以直接在32位机器上使用它。如果它是专为64位,那么你就必须与供应商联系,并从他们那里得到一个32位版本。

If the DLL is built for 32 bits then you can use it directly on your 32-bit machine. If it's built for 64 bits then you'll have to contact the vendor and get a 32-bit version from them.

当你有DLL,通过运行C寄存器是: WINDOWS SYSTEM32 regsvr32.exe的

When you have the DLL, register it by running c:windowssystem32regsvr32.exe.