目标4.5.1,并且x64上任何CPU以32位运行,4.5以64位运行,为什么? [英] Target 4.5.1 and Any CPU runs as 32 bit on x64, 4.5 runs as 64 bit, Why?

查看:73
本文介绍了目标4.5.1,并且x64上任何CPU以32位运行,4.5以64位运行,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio目标4.5.1和任何CPU在x64上均以32位运行,但是当目标为4.5和任何CPU时,它将在x64系统上以64位运行。为了使它在WOW模式下运行,4.5.1中进行了哪些更改?

Visual Studio target 4.5.1 and Any CPU runs as 32 bit on x64, but when targeting 4.5 and Any CPU it will run as 64 bit on x64 system. What has changed in 4.5.1 to make it run in WOW mode?

希望这很有意义...

Hope this makes sense...

推荐答案

.NET 4.5.1中的任何更改都不会影响进程的位数。

Nothing changed in .NET 4.5.1 that affects the bitness of the process.

一个非常常见的陷阱是程序员过多注意平台名称。例如,突出显示在构建+配置管理器对话框中。对于托管项目,该名称是不相关。这仅取决于基于平台选择以不同方式生成代码的项目类型。 C ++项目。

A very common trap is that programmers pay too much attention to the Platform name. Prominently displayed in the Build + Configuration Manager dialog for example. The name is irrelevant for managed projects. It only matters to the kind of projects that generate code differently based on the Platform selection. C++ projects.

更糟糕的是,不同VS版本之间默认的平台名称已更改。它始终是AnyCPU。然后在VS2010中将其更改为x86。这引起了巨大的混乱,因此在VS2012中将其更改回AnyCPU。

What's worse is that the default Platform name changed between different VS versions. It always used to be AnyCPU. Then it was changed to x86 in VS2010. That caused massive confusion so it was changed back to AnyCPU in VS2012.

有效的 real 设置位于Project + Properties,Build中标签,C#IDE的平台目标设置。对于VS2012及更高版本,首选32位复选框也适用。仅对于EXE项目,它首先运行并锁定位数。如果选择x86(或在方框中打勾),则指示CLR使用x86抖动而不是x64抖动。

The real setting that has an effect is in Project + Properties, Build tab, Platform target setting for the C# IDE. For VS2012 and up also the "Prefer 32-bit" checkbox. Only for the EXE project, it runs first and locks-in the bitness. If you pick x86 (or tick the box) then the CLR is instructed to use the x86 jitter instead of the x64 jitter.

首选32位复选框为默认情况下为新项目打开。因此,您已经自动在AnyCPU的平台名称和正在运行的进程的实际位数之间出现不匹配。哦,很高兴。

The "Prefer 32-bit" checkbox is turned on by default for a new project. So you already automatically have a mismatch between the Platform name of AnyCPU and the actual bitness of the running process. Oh joy.

这篇关于目标4.5.1,并且x64上任何CPU以32位运行,4.5以64位运行,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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