简体   繁体   English

缺少调试|项目的任何CPU构建配置和在Windows x64上默认为Debug | x86

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

I've just recently reinstalled Windows 7 x64 on my box. 我刚刚在我的盒子上重新安装了Windows 7 x64。 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. 我相信Windows或.NET x64存在配置问题。

Symptoms 症状

  1. The default build configurations for new projects is Debug|x86 . 新项目的默认构建配置是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 . 我正在运行x64操作系统,我有理由相信,在此之前的最后三个版本中,默认的构建配置是Debug | Any CPU
  2. Any CPU does not exist as a build configuration for projects at all, and I'm reasonably sure it should. 任何CPU根本不存在作为项目的构建配置,我有理由相信它应该存在。 To build anything x64 I need to explicitly add an x64 platform for the project. 要构建任何x64,我需要为项目显式添加一个x64平台。

Am I correct in thinking that Debug|Any CPU is normally the default configuration. 我认为Debug | Any CPU通常是默认配置是正确的。 If so, what are some possible causes for this not being the case for any new projects created? 如果是这样,那么创建任何新项目的情况可能是什么原因?

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 . 在Visual Studio 2010中,新项目的默认值已更改为x86 - 您可以在Rick Byers的博客文章中阅读MS的一些推理。 任何CPU Exes通常都比它们的价值更麻烦

You should be able to add Any CPU as an additional platform in the Configuration Manager dialog though. 您应该能够在Configuration Manager对话框中添加任何CPU作为附加平台。 I have Windows Vista x64 & Visual Studio 2010 and get options for Any CPU, x64 and Itanium. 我有Windows Vista x64和Visual Studio 2010,并获得Any CPU,x64和Itanium的选项。 You could try re-running the installer for Visual Studio and see if there were any options you didn't install. 您可以尝试重新运行Visual Studio的安装程序,看看是否有任何未安装的选项。

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. 有趣的是,似乎x86只是新EXE项目的默认设置 - 如果您创建一个新的类库项目,它将默认为任何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. 这是有道理的,因为它是EXE文件的平台,它决定了运行哪个版本的CLR,而x86和x64 EXE文件都可以加载任何CPU DLL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM