在 VB6 清单中包含 .NET 程序集?
我正在开发一个 vb6 项目,想要创建一个清单,因此不需要注册。
我使用 MMM(Make My Manifest)工具扫描 VB6 项目中的 dll 依赖项并生成清单。
但是,MMM 不包含 tlb 文件,并且我有一个用 .net 编写的 Client.dll 和 Client.tlb,它们已暴露给 COM 并在我的 VB6 程序中使用。
我不建议你使用 Regasm,因为如果没有注册到注册表,那就太好了。
我尝试通过命令行中的 mt 工具生成单独的清单 'mt.exe -tlb:Client.tlb -dll:Client.dll -out:Client.manifest'
然后我想我可以通过以下方式合并 2 个清单: 'mt.exe -manifest program.exe.manifest client.manifest -out:program.exe.manifest'
但是,当我运行该程序时,我收到一个消息框,显示“运行时错误” -2147220999 (800401f9):自动化错误,Dll 中的错误
我在上面做的事情是否正确,任何人都有类似的经历,任何帮助表示赞赏。
I am working on a vb6 project and want to create a manifest so no registering is required.
I use MMM (Make My Manifest) tool which scans your VB6 project for dll dependencies and generates the manifest.
However, the MMM does not include tlb files, and I have a Client.dll and Client.tlb written in .net that which has been exposed to COM and used in my VB6 program.
I don't to you use Regasm as it would be nice if no register to the registry is done.
I tried to generate a seperate manifest for the via the mt tool in command line, 'mt.exe -tlb:Client.tlb -dll:Client.dll -out:Client.manifest'
Then I thought I could merge the 2 manifest via: 'mt.exe -manifest program.exe.manifest client.manifest -out:program.exe.manifest'
However, when I run the program I'm getting an message box that says ' Run-time error -2147220999 (800401f9): Automation error , Error in the Dll'
Am i doing things correctly above, anyone had similar experience, any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是 UMMM 如何执行此操作的简短描述:
首先,它为 .Net dll 生成一个用这个清单到临时文件
然后将此清单作为 RT_MANIFEST 资源 2 嵌入到 .Net dll 中
最后通过从 .Net dll 中提取
assembleIdentity
标记,从 VB6 可执行文件引用 .Net dll清单并将其添加到dependency\dependentAssembly
标记内的无注册表清单中,如下所示这样 Hans 提到的
clrClass
标记就会出现在 .Net dll 嵌入清单中,而不是出现在 VB6 可执行清单中。Here is a short description how UMMM does it:
First, for the .Net dll it generates a manifest to a temp file with this
Then embeds this manifest into .Net dll as RT_MANIFEST resource 2 with this
Finally references the .Net dll from the VB6 executable by extracting
assemblyIdentity
tag from .Net dll manifest and adding it to the reg-free manifest insidedependency\dependentAssembly
tag like thisThis way
clrClass
tags Hans mentions appear in the the .Net dll embedded manifest and not in the VB6 executable manifest.