VB.NET 程序集上的强名称验证失败
我有一个 VB.Net 1.1 应用程序在 Visual Studio 中编译后工作正常。但是,我想使用 ILMerge 将所有引用的程序集合并到一个可执行文件中,以便更轻松地移动。当我通过 ILMerge 发送它并尝试运行它后,我收到错误
“Assembly.exe 的强名称验证失败”......
但我的东西都不是强名称!我在这里看到这篇文章:强名称验证失败并尝试通过'sn.exe运行它 - Vr merged.exe' 但这给了我这个错误:
“merged.exe 不代表强命名的程序集”
其他人以前遇到过这个问题吗?我该如何修复它?
更新:
我开始觉得强名称验证并不是这里真正的问题。我正在针对 .NET v1.1 进行构建,并在安装了唯一 .NET 版本的计算机上运行(可能是 Windows 2003)。合并的可执行文件似乎在我尝试的每台 Windows 2003 计算机上都因该错误而死亡,但如果我尝试在更现代的操作系统 (Vista) 上运行它,它至少会启动,但这并不是一个很好的测试,因为环境不是适合真正的测试。
- 我已验证我的 app.config 具有正确的设置(指定 v1.1.4322 所需和受支持的运行时版本)
- 我在通过 ILMerge 运行程序集时使用 /targetplatform:v1.1 选项。
ILMerge 肯定是导致问题的原因(即在合并之前它工作正常),我只是不知道如何修复它。
I have a VB.Net 1.1 application works just fine after compiling in Visual Studio. However, I want to use ILMerge to combine all the referenced assemblies into a single executable just to make it easier to move around. After I send it through ILMerge and try to run it I get the error
"Strong name validation failed for assembly.exe" .....
But none of my stuff is strong named! I saw this post here: Strong Name Validation Failed and tried running it through 'sn.exe -Vr merged.exe' but that gives me this error:
"merged.exe does not represent a strongly named assembly"
Has anyone else had this problem before? How do I fix it?
UPDATE:
I'm starting to feel like Strong name validation isn't the real problem here. I'm building against .NET v1.1 and running on a machine where that is the only .NET version installed (happens to be Windows 2003). The merged executable appears to die with that error on every Windows 2003 machine I try, but if I try to run it on a more modern OS (Vista) it at least starts, but that's not really a good test since the environment isn't fit for a real test.
- I have verified that my app.config has the correct settings (specifying required and supported runtime version of v1.1.4322)
- I use the /targetplatform:v1.1 option when running my assemblies through ILMerge.
ILMerge is definitely causing the problem (i.e. it works fine before I merge), I just don't know how to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须找到并下载 ILMerge (v1.1) 的一个非常旧的版本才能使我的合并二进制文件正常工作;当前 ILMerge 应用程序构建 .NET 1.1 程序集的方式一定存在错误。值得庆幸的是,我们内部有一个,因为我可能永远不会在网上找到它。
I had to find and download a very old version of ILMerge (v1.1) in order for my merged binary to work; there must be a bug in the way the current ILMerge application builds .NET 1.1 assemblies. Thankfully we had one internally because I would probably have never found it online.