Missing Debug|Any CPU build configuration for projects and defaulting to Debug|x86 on Windows x64

大城市里の小女人 提交于 2019-12-10 12:34:19

问题


I've just recently reinstalled Windows 7 x64 on my box. The installation succeeded, and I've had no issues with the operating system as a whole. I believe there is a configuration issue with either Windows or .NET x64.

Symptoms

  1. The default build configurations for new projects is Debug|x86.
    This doesn't feel right. I'm running an x64 OS, and I'm reasonably confident that for the last three versions prior to this the default build config has been Debug|Any CPU.
  2. Any CPU does not exist as a build configuration for projects at all, and I'm reasonably sure it should. To build anything x64 I need to explicitly add an x64 platform for the project.

Am I correct in thinking that Debug|Any CPU is normally the default configuration. If so, what are some possible causes for this not being the case for any new projects created?


回答1:


The default for new projects was changed to x86 in Visual Studio 2010 - you can read some of MS' reasoning for this in Rick Byers' blog post Any CPU Exes are usually more trouble than they're worth.

You should be able to add Any CPU as an additional platform in the Configuration Manager dialog though. I have Windows Vista x64 & Visual Studio 2010 and get options for Any CPU, x64 and Itanium. You could try re-running the installer for Visual Studio and see if there were any options you didn't install.

Interestingly, it seems x86 is only the default for new EXE projects - if you create a new Class Library project it will default to Any CPU. This makes sense as it is the platform of the EXE file that determines which version of the CLR to run, whereas an Any CPU DLL can be loaded by both x86 and x64 EXE files.



来源:https://stackoverflow.com/questions/3306683/missing-debugany-cpu-build-configuration-for-projects-and-defaulting-to-debugx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!