COM类错误80040154 [英] COM class error 80040154

查看:134
本文介绍了COM类错误80040154的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我现在已经被这个错误困住了一段时间并且真的想要修复它。

这里的问题是,我需要重写代码并更新它。

当我使用旧代码时,页面加载应该这样做,但在新页面上它会出现以下错误:

Hello,

I have been stuck with this error for a while now and really want to get it fixed.
The catch here is, i need to rewrite code and update it.
when i use the old code the page loads as its supposed to do, but on the new page it gives the following error:


由于以下错误,检索具有CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D}的组件的COM类工厂失败:80040154.

描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。


异常详细信息:System.Runtime.InteropServices.COMException:由于以下错误,检索具有CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D}的组件的COM类工厂失败: 80040154.
Retrieving the COM class factory for component with CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D} failed due to the following error: 80040154.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D} failed due to the following error: 80040154.



在常见事情开始涌入之前...


regsvr32< dll> - 给出错误未找到入口点,进一步谷歌没有可用的结果

regasm< dll> / TLB:其中DLL> - 没有.NET dll文件 - 错误

没有调试平台设置为x86,只有x64 .NET

没有CLSID的注册表项

DCOMConfig中没有组件

它是一个自定义的dll文件,所以大多数页面都没用,因为它们引用了Excel或其他一些应用程序


谢谢提前

Before the common things start pouring in...

regsvr32 <dll> - Gives error "entry point not found, further google had no usable results"
regasm <dll> /tlb:<dll> - "no .NET dll file"-ish error
no debug platform to set to x86 nor x64 only .NET
No registry key with the CLSID
No component in the DCOMConfig
Its a custom dll file, so most pages are useless since they reference to Excel or some other application

thanks in advance

推荐答案

编辑:查看我在 COM类错误80040154


什么操作系统?它是64位吗?


此问题可能是由于未正确注册/安装DLL或未正确配置权限以允许运行ASP.net应用程序的用户访问DLL。

你需要使用regsvr32卸载旧的COM对象:
regsvr32 -u< dllName> .dll


请进一步阅读以获取有关如何在64位操作系统上使用regsvr32工具的更多说明。


请注意,如果旧的COM对象不再存在你会遇到问题。如果可能,请确保旧的COM对象位于其注册的目录中,然后调用regsvr32将其卸载。


卸载后,删除旧的DLL并将其替换为新的一,然后运行regsvr32命令:
regsvr32< dllName> .dll


请注意,如果你运行以下它有时会提供关于没有找到入口点的消息,因此坚持使用上面列出的命令:
regsvr32 -i< dllname> .dll


确保将使用该应用程序的用户具有足够的权限来访问DLL(至少读取/执行...但如果您的应用程序需要,您可能需要更多权限)。如果您没有使用模拟,则默认的匿名用户帐户是ASPNET,或IIS_IUSRS和IIS_WPG Windows用户帐户。


一旦完成此操作,请尝试再次运行该应用程序。

如果你还有问题,那么我建议再次卸载DLL,然后通过注册表查找你的DLL的任何可能没有被正确删除/卸载的条目。如果您的注册表中有条目引用任何旧的DLL(不再存在),那么您将遇到问题。


一旦卸载了COM对象并清理了注册表尝试使用regsvr32注册新的。


请注意,如果您的COM对象是32位且存在于64位操作系统上的SysWOW 64文件夹中您不应该对此文件夹上的匿名用户帐户授予读/写权限(实际上我认为操作系统阻止您这样做)。这可能会危及您的操作系统!


另外,请注意,放置COM对象的文件夹必须可供ASPNET应用程序访问(特别是如果COM对象正在读/写文件等)。


因此,如果您的COM组件位于SysWoW64文件夹中,请将其从那里移到可以应用权限的位置,以允许Internet用户使用COM组件并防止他们从访问其他任何东西。完成此操作并应用正确的权限后,您需要使用32位版本的regsvr32工具来注册32位COM组件。此工具位于 C:\Windows \SysWoW64 \ 目录中。常规的regsvr32工具用于注册64位组件(这个常规工具位于 C:\ Windows \ system32 \ 文件夹中)。


如果你的COM对象真的是一个真正的com组件(不是使用.NET代码开发的)那么regasm将不起作用。



此外,请注意如果您的COM组件是32位,则需要在Visual Studio项目中配置构建设置以定位x86平台(32位平台)。如果您的项目针对的是64位平台,您将继续收到此错误。


我想我可以将所有内容总结为4分:
  • 确保在尝试安装新版本之前卸载所有旧版本的DLL
  • 确保您的ASPNET用户帐户(运行ASP.NET应用程序的帐户)具有访问COM对象的权限
  • 确保使用正确的regsvr32工具注册COM组件
  • 确保您已将项目配置为定位到适当的平台(即:它必须以x86平台为目标,如果COM组件是一个32位组件)
check out this quick summary/article that I did on the COM class error 80040154

What operating system? Is it 64 bit?

This problem could be caused by not registering/installing the DLL correctly or if permissions are not configured properly to allow the user running the ASP.net application access to the DLL.

You need to uninstall the old COM object using regsvr32:
regsvr32 -u <dllName>.dll

Please read further down for more instructions on how to use the regsvr32 tool on 64bit operating systems.

Please note that if the old COM object doesn''t exist anymore you''re going to have a problem. If possible make sure the old COM object is in the directory where it was registered and then call the regsvr32 to uninstall it.

Once uninstalled, remove the old DLL and replace it with the new one and then run the regsvr32 command:
regsvr32 <dllName>.dll

Please note that if you run the following it sometimes comes up with the message about no entry points found so stick with the command listed above:
regsvr32 -i <dllname>.dll

Make sure that the user that will be using the application has sufficient permissions to access the DLL (at least read/execute...but you may need more if your application requires it). If you''re not using impersonation, the default anonymous user account is the ASPNET, or IIS_IUSRS and IIS_WPG Windows user account.

Once you''ve done this try running the application again.
If you''re still having problems then I would suggest uninstalling the DLL again and then go through the registry looking for any entries for your DLL that may not have been removed/uninstalled properly. If there are entries in your registry referencing any old DLL (that no longer exists) then you''re going to have problems.

Once you have uninstalled the COM object and cleaned your registry of it try registering your new one using regsvr32.

Please note that if your COM object is 32bit and it exists in a SysWOW 64 folder on 64 bit operating systems You SHOULD NOT give read/write permissions to the anonymous user account on this folder (in fact I think the operating system prevents you from doing this). This could compromise your operating system!

Also, please note that the folder that the COM object is placed into must be accessible to the ASPNET application (especially if the COM object is reading/writing files etc).

So, if your COM component is in the SysWoW64 folder, move it out of there to somewhere that you can apply permissions to that will allow the internet user to use the COM component and prevent them from accessing anything else. Once you have done this and applied the correct permissions, you need to use the 32 bit version of the regsvr32 tool to register the 32 bit COM component. This tool is located in the C:\Windows\SysWoW64\ directory. The regular regsvr32 tool is meant to register 64bit components (this regular tool is located in the C:\Windows\system32\ folder).

If your COM object is really a true com component (not developed using .NET code) then regasm will not work.


Also, please note that if your COM component is 32bit you need to configure your build settings in your Visual Studio project to target the x86 platform (the 32 bit platform). If your project is targeting a 64 bit platform, you will continue to get this error.

I guess I could have summed everything up into 4 points:
  • Make sure that you uninstall All old versions of the DLL before attempting to install the new one
  • Make sure that your ASPNET user account (the account under which your ASP.NET application runs) has permissions to access the COM object
  • Make sure that you use the correct regsvr32 tool to register the COM component
  • Make sure that you have configured your project to target the appropriate platform (ie: it must target a x86 platform if the COM component is a 32 bit component)


嗨感谢您的回复,我只是尝试了你的观点。


卸载和重新安装没有工作,所有dll文件和命令都给出了未找到入口点无论是安装还是卸载。

我确保每个用户都可以完全控制文件夹,甚至可以做到非常激进。并且让每个人都成为管理员的一员。


操作系统是32位Win2k3服务器


谢谢您的时间
hi thanks for replying, i just tried your points.

Uninstalling and Reinstalling didnt work, all dll files and the commands gave "entry point not found" whether it was install or uninstall.
I made sure the everyone user has full control on the folder and even done quite "agressive" and made everyone part of administrators.

the OS is 32bit Win2k3 Server

thank you for your time


跟进:


i解决了这个问题,我正在创建一个新对象。在旧代码中,对象的新实例永远不会被创建,但在使用时会被填充。

不知何故它不喜欢new()语句。
follow up:

i fixed the problem, i was creating a new object. in the old code a new instance of the object is never made but filled when used.
somehow it didnt like the new() statement.


这篇关于COM类错误80040154的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆