简体   繁体   English

在VB6清单中包含.NET程序集?

[英]Including .NET assemblies in a VB6 manifest?

I am working on a vb6 project and want to create a manifest so no registering is required. 我正在开发一个vb6项目,并希望创建一个清单,因此不需要注册。

I use MMM (Make My Manifest) tool which scans your VB6 project for dll dependencies and generates the manifest. 我使用MMM(Make My Manifest)工具扫描你的VB6项目的dll依赖项并生成清单。

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. 但是,MMM不包含tlb文件,我有一个用.net编写的Client.dll和Client.tlb,它已暴露给COM并在我的VB6程序中使用。

I don't to you use Regasm as it would be nice if no register to the registry is done. 我不会使用Regasm,因为如果没有注册表注册就行了会很好。

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' 我尝试在命令行中通过mt工具生成一个单独的清单,'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' 然后我想我可以合并2清单:'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' 但是,当我运行程序时,我收到一个消息框,显示“运行时错误-2147220999(800401f9):自动化错误,Dll中出错”

Am i doing things correctly above, anyone had similar experience, any help appreciated. 我上面做的正确,任何人都有类似的经验,任何帮助赞赏。

Here is a short description how UMMM does it: 以下是UMMM如何做到的简短说明:

  1. First, for the .Net dll it generates a manifest to a temp file with this 首先,对于.Net dll,它使用this生成一个临时文件的清单

     mt.exe -nologo -managedassemblyname:"{dotnet_dll}" -nodependency -out:"{dotnet_dll}.manifest" 
  2. Then embeds this manifest into .Net dll as RT_MANIFEST resource 2 with this 然后将此清单作为RT_MANIFEST资源2嵌入.Net dll中

     mt.exe -nologo -manifest "{dotnet_dll}.manifest" -outputresource:"{dotnet_dll}";2 
  3. 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 inside dependency\\dependentAssembly tag like this 最后通过从.Net dll清单中提取assemblyIdentity标记并将其添加到dependency\\dependentAssembly标记内的reg-free清单,从VB6可执行文件中引用.Net dll,如下所示

     <dependency> <dependentAssembly> <assemblyIdentity name="PdfSigner" version="1.0.0.0" processorArchitecture="msil" /> </dependentAssembly> </dependency> 

This way clrClass tags Hans mentions appear in the the .Net dll embedded manifest and not in the VB6 executable manifest. 这样, clrClass标签Hans提及出现在.Net dll嵌入式清单中,而不出现在VB6可执行文件清单中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM