获取 BadImageFormatException
我有一些来自 System.AddIn 的插件。但是当运行 AddInStore.Rebuild 时,
string[] warnings = AddInStore.Rebuild(addInRoot);
我收到一个警告字符串:
该文件不是有效的二进制文件: D:\AK\AS\ConverterModule\output\AddIns\CompositeFileZip\7z.dll 文件名: D:\AK\AS\ConverterModule\output\AddIns\Composi...
7z.dll 不是插件程序集,而是 CompositeFileZip 插件使用的 7z 文件。我不太清楚重建功能到底在做什么。它是否试图将 7z.dll 添加为插件?
I have some addins from the System.AddIn. But when running the AddInStore.Rebuild,
string[] warnings = AddInStore.Rebuild(addInRoot);
then I get a warning string back:
The file is not a valid binary:
D:\AK\AS\ConverterModule\output\AddIns\CompositeFileZip\7z.dll
File Name:
D:\AK\AS\ConverterModule\output\AddIns\Composi...
The 7z.dll is not the addin assembly, but the 7z file that the CompositeFileZip addin uses. I can't quite figure out what exactly the rebuild function is doing. Is it trying to add the 7z.dll as an addin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 System.AddIn 或 7z 组件,但导致
BadImageFormatException
的一个非常常见的原因是尝试加载标记为 64 位(或依赖于本机 64 位)的程序集.dll)在 32 位系统上,反之亦然。检查您的
7z.dll
及其依赖项是否是针对与您看到BadImageFormatException
的系统相同的体系结构构建的。您可以从 Visual Studio 命令提示符中转储 7z.dll 的标头并查找计算机体系结构来执行此操作:I'm not familiar with System.AddIn or the 7z component, but a very common cause of
BadImageFormatException
is attempting to load an assembly that is marked as 64-bit (or dependent on a native 64-bit .dll) on a 32-bit system, or vice versa.Check whether your
7z.dll
and its dependencies are built for the same architecture as the system where you see theBadImageFormatException
. You can do this from a Visual Studio command prompt by dumping the headers for7z.dll
and looking for the machine architecture: