Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change target CPU settings in Visual Studio 2010 Express

I wish to change the target CPU settings from "Any CPU" to "x86" in Visual Studio 2010.

I read on another website that I need to do the following:

  1. Go to the startup project of your program.
  2. Open the properties window.
  3. Click the compile tab.
  4. Click advanced compile options.
  5. Change the target CPU options to 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",

Platform contains nothing apart from "Any CPU".

like image 696
Shrayas Avatar asked Nov 05 '10 07:11

Shrayas


People also ask

How do I change a platform target from x86 to a CPU?

Select x86 in the Copy settings from drop-down list box. Click OK. In the Configuration Manager dialog, be sure the box in the Build column is checked for all projects in the solution. Click Close.

How do I change from x86 to x64 in Visual Studio?

To configure a project to target a different platformOn the menu bar, choose Build > Configuration Manager. In the Active solution platform list, choose a platform for the solution to target, and then choose the Close button.

How do I add x86 to Visual Studio?

Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager (This is only applicable to Visual Studio 2010 Express Edition and NOT for 2008 Express Edition) Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE.

How do I create a 64 bit project in Visual Studio?

Choose the Configuration Manager button to open the Configuration Manager dialog box. In the Active Solution Platform drop-down list, select the <New...> option to open the New Solution Platform dialog box. In the Type or select the new platform drop-down list, select a 64-bit target platform.


1 Answers

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:

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":

Screenshot of the options dialog to enable "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.

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".

like image 123
Cody Gray Avatar answered Sep 23 '22 06:09

Cody Gray