visual-studio 在 Visual Studio 2010 Express 中更改目标 CPU 设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4104228/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change target CPU settings in Visual Studio 2010 Express
提问by Shrayas
I wish to change the target CPU settings from "Any CPU" to "x86" in Visual Studio 2010.
我希望在 Visual Studio 2010 中将目标 CPU 设置从“任何 CPU”更改为“x86”。
I read on another website that I need to do the following:
我在另一个网站上读到我需要执行以下操作:
- Go to the startup project of your program.
- Open the properties window.
- Click the compile tab.
- Click advanced compile options.
- Change the target CPU options to x86.
- 转到您程序的启动项目。
- 打开属性窗口。
- 单击编译选项卡。
- 单击高级编译选项。
- 将目标 CPU 选项更改为 x86。
But I don't see the "compile" tab anywhere in the properties.
但是我在属性中的任何地方都没有看到“编译”选项卡。
Please help me at the earliest.
请尽早帮助我。
Update: I do see a platform dropdown, but that contains nothing apart from "Any CPU",
更新:我确实看到了一个平台下拉菜单,但除了“Any CPU”之外没有任何内容,
.
.
回答by Cody Gray
I believe the reason you don't see the Compile tab in the project properties is because you're using the Express edition. Optimization for a specific CPU type is not offically supported in this edition. However, you should be able to change the active solution platform in the following way:
我相信您在项目属性中看不到 Compile 选项卡的原因是因为您使用的是 Express 版本。此版本不正式支持针对特定 CPU 类型的优化。但是,您应该能够通过以下方式更改活动解决方案平台:
From the "Tools" menu, select the "Options" item, and then select the "Projects and Solutions" option in the listbox on the left-hand side of the Options dialog. (You might have to check "Show all settings" first.) Check the box that says "Show advanced build configurations":
从“工具”菜单中,选择“选项”项,然后在“选项”对话框左侧的列表框中选择“项目和解决方案”选项。(您可能必须先选中“显示所有设置”。)选中“显示高级构建配置”框:


Then, on the "Build" menu, see if you have an item called "Configuration Manager". If not, you need to add the item to the menu (right-click on any area in the toolbar and choose "Customize" at the bottom of the list).
然后,在“构建”菜单上,查看是否有一个名为“配置管理器”的项目。如果没有,您需要将该项目添加到菜单中(右键单击工具栏中的任何区域,然后选择列表底部的“自定义”)。
Once you've opened the Configuration Manager dialog, go to the "Active solution platform" drop-down box and choose "New". From the "New Solution Platform" dialog that appears, you should be able to choose "x86" from the first drop-down box.
打开配置管理器对话框后,转到“活动解决方案平台”下拉框并选择“新建”。在出现的“New Solution Platform”对话框中,您应该能够从第一个下拉框中选择“x86”。
Alternatively, it looks like you can manually edit the project file to specify the CPU type. See Changing the target CPU in VB Express 2008. It looks like it amounts to simply changing the <PlatformTarget>under the first <PropertyGroup>section to "x86".
或者,您似乎可以手动编辑项目文件以指定 CPU 类型。请参阅在 VB Express 2008 中更改目标 CPU。看起来它相当于简单地将<PlatformTarget>第一<PropertyGroup>部分下的更改为“x86”。
回答by Izzy Helianthus
To make the Buildmenu bar appear on your Visual Studio 2010, go to menu Tools -> Settings -> check Expert Settings. So later on you can use Configuration Manager.
要使构建菜单栏出现在 Visual Studio 2010 上,请转到菜单工具 -> 设置 -> 检查专家设置。所以稍后您可以使用配置管理器。
回答by Aamir
I don't have Visual Studio 2010 right now, but in Visual Studio 2008, you have to first add a configuration through Build -> Configuration Manager.
我现在没有 Visual Studio 2010,但在 Visual Studio 2008 中,您必须首先通过Build -> Configuration Manager.
After you have added the configuration, you can simply select the Active Configuration through the drop down menu.
添加配置后,您只需通过下拉菜单选择活动配置。
回答by ShailendraRPhadke
I don't have Visual Studio 2010 right now, but in Visual Studio 2008, you have to first add a configuration through Build -> Configuration Manager.
我现在没有 Visual Studio 2010,但在 Visual Studio 2008 中,您必须首先通过Build -> Configuration Manager.
After you have added the configuration, you can simply select the Active Configurationthrough the drop down menu.
添加配置后,您只需Active Configuration通过下拉菜单选择即可。

