更改第三方 .NET 程序集的平台目标
如何在无法访问源代码的情况下更改已编译程序集上的“平台目标”?
对于这个特定实例,我有一个已编译的 .NET 程序集作为 DLL,标记为 x86,我需要将其更改为 AnyCPU。
为什么?:
- 处理这个问题时遇到麻烦: http://blogs.msdn.com/b/visualstudio/archive/2010/06/19/resgen-exe-error-an-attempt-was-made -to-load-a-program-with-an-in Correct-format.aspx
- 当依赖于
x86
库时,第三方提供商将程序集保留在AnyCPU
上时出现问题。 - 当平台独立时,第三方提供商将程序集保留在 x86 上会出现问题。
How do I change the 'Platform Target' on compiled assemblies without having access to the source?
For this particular instance, I have an compiled, .NET assembly as a DLL that is marked as x86
and I need to change it to AnyCPU
.
Why?:
- Trouble dealing with this issue:
http://blogs.msdn.com/b/visualstudio/archive/2010/06/19/resgen-exe-error-an-attempt-was-made-to-load-a-program-with-an-incorrect-format.aspx - Trouble with third party providers leaving assemblies on
AnyCPU
when dependant onx86
libs. - Trouble with third party providers leaving assemblies on
x86
when platform independant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用 CorFlags 实用程序:http://msdn。 microsoft.com/en-us/library/ms164699%28VS.80%29.aspx
You can try with CorFlags utility: http://msdn.microsoft.com/en-us/library/ms164699%28VS.80%29.aspx
我认为您需要意识到库开发人员设置 x86 是因为仅依赖 32 位 DLL。
您很可能需要将自己的项目编译为 x86,而不是相反。
这很糟糕,但开发人员将其设置为 x86 而不是保留默认的 AnyCPU 可能是有充分理由的......
I think you need to realize that the library developer set the x86 because of a dependency on a DLL that is 32bit only.
More than likely what you have to do is compile your own project to x86, rather than the other way around.
It sucks, but there is probably a good reason that the developer set it to x86 rather than leaving the default of AnyCPU...