具有 64 位程序集与 32 位程序集的 .NET 版本
如果应用程序中引用的某些程序集仅使用 32 位(而不是 AnyMachine)设置进行编译,将加载什么版本的 .NET(64 位与 32 位)?如果至少一个引用的程序集仅编译为 32 位,应用程序是否仍以 64 位运行,或者是否会强制以 32 位运行?该应用程序正在运行.NET 3.5。
What version of .NET (64-bit vs. 32-bit) will be loaded if some of the assemblies referenced in an app are compiled with 32-bit only (instead of AnyMachine) setting? Will the app still run as 64-bit or will it be forced to run as 32-bit if at least one of the referenced assemblies is compiled as 32-bit only? The app is running .NET 3.5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应用程序将被迫以 32 位运行
The application will be forced to run as 32-bit
位数由 EXE 上的平台目标设置决定。没有机制可以确保引用仅 32 位程序集的 EXE 也将强制在 32 位模式下运行。该程序集将无法加载并出现 BadImageFormatException。
如果您的程序依赖于此类 DLL,那么您必须强制 EXE 项目上的平台目标从 AnyCPU 到 x86。
The bit-ness is determined by the Platform Target setting on the EXE. There is no mechanism to ensure that a EXE that references a 32-bit only assembly will be forced to run in 32-bit mode as well. The assembly will simply fail to load with a BadImageFormatException.
If your program has a dependency on such a DLL then you must force the Platform Target on your EXE project from AnyCPU to x86.