【问题标题】:Generate tlb from dll in same directory under another name以另一个名称从同一目录中的 dll 生成 tlb
【发布时间】:2018-12-30 00:15:21
【问题描述】:

我想创建一个类型库 (tlb),其名称不同于 dll:

c:\windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "c:\program files (x86)\sample_program\Library.dll" "c:\program files (x86)\sample_program\TypeLibname.tlb" /codebase

在 Powershell 中执行此行时,不会出现错误。

Microsoft .NET Framework 程序集注册实用程序 4.7.3056.0 用于 Microsoft .NET Framework,版本 4.7.3056.0 [...] 类型已注册

所以必须生成一个 tlb。虽然 tlb 到处都是,但不在所需的目录“c:\program files (x86)\sample_program\”中

有什么想法吗?

谢谢!

一切顺利, 斯蒂芬

【问题讨论】:

  • 命令不正确。输入 regasm.exe /?获取使用指南。
  • 见下面我的回答。缺少用于生成类型库的开关是 /tlb。

标签: dll tlb


【解决方案1】:

只需插入 /tlb 并将表达式更改为:

c:\windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "c:\program files (x86)\sample_program\Library.dll" /tlb:TypeLibname.tlb /codebase

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-11
    • 2020-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-22
    相关资源
    最近更新 更多