具有 64 位程序集与 32 位程序集的 .NET 版本

发布于 2024-08-30 15:17:14 字数 151 浏览 1 评论 0原文

如果应用程序中引用的某些程序集仅使用 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 技术交流群。

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

发布评论

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

评论(2

橘香 2024-09-06 15:17:14

应用程序将被迫以 32 位运行

The application will be forced to run as 32-bit

樱娆 2024-09-06 15:17:14

位数由 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.

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