COM:OLE 查看器无法创建类的实例
使用 OLE/COM Viewer 我收到以下错误(当扩展我的注册类时)
CoGetClassObject failed.
<No system message defined> severity: SEVERITY_ERROR, facility:
<Unknown Facility> ($80131522)
COM 类是使用 RegAsm 注册的 C# 类。
这个错误是什么意思?
编辑:
参见 http://www.dotnet247.com/247reference/msgs/24 /124704.aspx 用于类似问题。
Using OLE/COM Viewer I get the following error (when expanding my registered class)
CoGetClassObject failed.
<No system message defined> severity: SEVERITY_ERROR, facility:
<Unknown Facility> ($80131522)
The COM Class is a C# class registered with RegAsm.
What does this error mean?
Edit:
See http://www.dotnet247.com/247reference/msgs/24/124704.aspx for similar issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
COM 注册程序集的 bin 文件夹中是否缺少依赖程序集?或者应该位于 GAC 中但实际上并不在 GAC 中的依赖程序集?
您还可以使用 /codebase 开关解决问题,该开关将添加一个指向程序集位置的注册表项。
您还可以使用 fuslogvw< /a> 来查看当您的 .NET 程序集被 OLE Viewer 绑定到时发生了什么。
Is there a dependent assembly missing from the bin folder of the COM Registered assembly? Or a dependent assembly that supposed to be in the GAC that isn't actually in the GAC?
You may also be able to resolve you're issue using /codebase switch which will add a registry entry pointing to the location of your assembly.
You might also be able to find out more using fuslogvw to see what's happening when your .NET assemblies are being bound to by OLE Viewer.
发现问题:
通过查看fuslogvw日志,我了解到OleViewer在与OleViewer.exe相同的文件夹中查找与它正在查找的程序集匹配的任何程序集(!)。偶然的机会,我运行 OleViewer 的文件夹中有一个旧版本的程序集。所以我要做的就是将 OleViewer.exe 复制到我的程序集注册的文件夹中。奇怪但真实!
Found the problem:
By looking at the fuslogvw logs I learned that OleViewer looks for any assembly in the same folder as OleViewer.exe that matches the assembly it is looking for (!). By chance I had an old version of my assembly in the folder I was running OleViewer from. So what I had to do was to copy OleViewer.exe to the folder where my assembly was registered. Strange but true!