作为AnyCPU进行编译会产生在64位计算机上设置32BIT标志的程序集 [英] Compiling as AnyCPU produces assembly with 32BIT flag set on 64-bit machine

查看:344
本文介绍了作为AnyCPU进行编译会产生在64位计算机上设置32BIT标志的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在64位计算机上的Visual Studio 2013中创建了一个全新的.NET 4.5 WinForm项目。编译后,我在.exe中运行corflags并设置了32BIT标志。

I've created a brand new .NET 4.5 WinForm project in Visual Studio 2013 on a 64-bit machine. After compiling, I run corflags in the .exe and the 32BIT flag is set.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 131075
ILONLY    : 1
32BIT     : 1
Signed    : 0

当我查看任务管理器时,它也被标记为32位进程。

When I take a look at Task Manager, it's also marked as a 32 bit process.

我没有添加任何引用,可能会迫使它以32位模式运行。我看了看项目文件,也没有发现任何可疑的东西。

I didn't add any references that would maybe force it to run in 32-bit mode. I took a look at the project file and didn't spot anything suspicious either.

我可以运行 corflags / 32BIT-在程序集上运行,并且可以作为64位进程正常运行。

I can run corflags /32BIT- on the assembly and it runs just fine as a 64-bit process.

什么原因可能导致它编译为32位可执行文件?

What could be causing it to compile as a 32-bit executable?

推荐答案

在项目的属性页中,有一个名为构建(A)的页面。

In the project Property Pages is a page called "Build" (A).

平台目标字段(B)下的首选32位字段(C)。

Under the "Platform Target" field (B), is the "Prefer 32bit" field (C).

您可以切换该设置,以从

You can toggle that to remove the 32bit flag from the corflags.


(图片来自VS 2015)

(Image from VS 2015)

这篇关于作为AnyCPU进行编译会产生在64位计算机上设置32BIT标志的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆