如何让 tlbimp 不自动生成引用类型的程序集?

发布于 2024-07-18 05:35:14 字数 593 浏览 7 评论 0原文

我想使用 .NET SDK 中包含的 tlbimp.exe 工具从类型库创建互操作程序集。

我的问题是源类型库引用了另一个我没有的库中的类型。 如何让 tlbimp 不自动生成引用类型的程序集?

我收到以下错误:

Resolving reference to type library 'GridEX20'. 
Auto importing 'GridEX20' to 'C:\tmp\GridEX20.dll'. 
TlbImp : error TI0000 : System.Runtime.InteropServices.COMException - Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

使用 进程监视器 我得出的结论是找到了 GridEX20 库,但它引用了另一个未找到的库,并且当找不到该库时 tlbimp 会报告错误。

I want to create an interop assembly from a type library using the tlbimp.exe tool that is included in the .NET SDK.

My problem is that the source type library is referencing a type in another library that I do not have available. How can I get tlbimp to not automatically generate assemblies for referenced types?

I get the following error:

Resolving reference to type library 'GridEX20'. 
Auto importing 'GridEX20' to 'C:\tmp\GridEX20.dll'. 
TlbImp : error TI0000 : System.Runtime.InteropServices.COMException - Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

Using Process Monitor I have concluded that the GridEX20 library is found but it refers to another library that is not found and tlbimp reports an error when this library can't be found.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最终幸福 2024-07-25 05:35:14

您可以尝试 /strictref 选项,但我认为它不会对您有帮助。

我建议您使用 Dependency Walker 检查 GridEX20.dll(对于 VS2005,它位于 C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin 中,但我认为它不再提供 - 您可以找到版本此处)。

这应该告诉您 dll 依赖于哪些程序集 - 这至少会确认您最初的假设是否正确。

You can try the /strictref option, but I don't think it's going to help you.

I suggest you examine the GridEX20.dll with Dependency Walker (for VS2005, it was found in C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin, but I don't think it's shipped any more - you can find a version here).

That should tell you which assemblies the dll depends on - which will at least confirm whether your initial hypothesis is correct.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文