可以安装吗。 NET COM 库位于网络共享文件夹上?
使用位于网络文件夹中的 reg asm 注册的 COM 服务器无法正常工作。当您尝试创建对象时,出现错误“自动化错误”。如果 dll 位于本地磁盘上,则一切正常。
附加信息:
.Net 3.5 编写的 COM 库
通过 VB 宏访问 COM
图书馆有一个响亮的名字
COM Server registered with reg asm located in a network folder not working properly. When you try to create the object gets the error "Automation error". Everything works correctly if the dll is located on a local disk.
Additional Information:
COM library written in. Net 3.5
Access to the COM through the VB macro
Library has a strong name
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 COM 服务器放在网络共享上是自找麻烦。当映射的驱动器号不再映射或映射到其他地方时,它会随机失败。您至少需要服务器的 UNC 路径(例如
\\machine\folder\etc
),但不确定是否可以使用 /codebase 选项从 Regasm.exe 中获取此路径。验证注册表项值 HKLM\Software\Classes\CLSID{guid}。请确保您使用了 /codebase,没有它就无法工作。信任可能是一个问题,请使用 fuslogvw.exe 查看发生了什么。您需要 caspol.exe 来分配信任。
然后是依赖的 DLL,Windows 和 CLR 都无法找到它们。要查看到底发生了什么,请使用 SysInternals 的 ProcMon 实用程序。您将看到 COM 正在查找注册表项并搜索 DLL,并监视失败的调用。
Putting COM servers on a network share is asking for trouble. It will randomly fail when the mapped drive letter is no longer mapped or mapped elsewhere. You'll at least want the UNC path to the server (like
\\machine\folder\etc
), not so sure you'll get this out of Regasm.exe with the /codebase option. Verify the registry key value, HKLM\Software\Classes\CLSID{guid}. Do make sure you used /codebase, this cannot work without it.Trust could be an issue, use fuslogvw.exe to see what's happening. You'll need caspol.exe to assign trust.
Then there's dependent DLLs, neither Windows nor the CLR will be able to find them. To see what is really going on use SysInternals' ProcMon utility. You'll see COM looking through registry keys and searching for DLLs, watch for failed calls.
可能该组件需要完全信任,而您没有运行 .net 4.0。在旧版本中,除非您手动更改权限集,否则不会授予网络位置完全信任。
It could be that the component requires full trust and you are not running .net 4.0. In older versions, network locations are not granted full trust unless you manually change the permission sets.