29

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shrayas
  • 6,784
  • 11
  • 37
  • 54

4 Answers4

44

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • Hey. Thanks for the info. I'm looking at the tools menu but i dont see the "Projects and Solutions" option. Is that an express problem too ? – Shrayas Nov 05 '10 at 08:57
  • 1
    Hmm, sorry about that... You're actually looking for the "Options" item on the Tools menu. Then in the Options dialog, Projects and Solutions is one of the options in the listbox on the left-hand side. You might have to check "Show all settings" at the bottom if it doesn't show up. – Cody Gray - on strike Nov 05 '10 at 09:00
  • 4
    Excellent! You're welcome. I think this is a great question because I imagine you're not the only one to run into this kind of limitation with VS Express. – Cody Gray - on strike Nov 05 '10 at 09:40
  • Cody, can you please advise why for Console App in Visual studio build configuration manager I can see only `x86` platform, though I can select any CPU platform tartget in project properties tab? – Johnny_D May 12 '14 at 09:39
  • @Johnny_D Uh, I'm guessing that it isn't appearing in the build configuration manager because you haven't actually created the platform target yet. – Cody Gray - on strike May 12 '14 at 12:51
8

To make the Build menu bar appear on your Visual Studio 2010, go to menu Tools -> Settings -> check Expert Settings. So later on you can use Configuration Manager.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Izzy Helianthus
  • 106
  • 1
  • 4
1

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.

After you have added the configuration, you can simply select the Active Configuration through the drop down menu.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Aamir
  • 14,882
  • 6
  • 45
  • 69
-1

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.

After you have added the configuration, you can simply select the Active Configuration through the drop down menu.

spenibus
  • 4,339
  • 11
  • 26
  • 35
SRP
  • 29
  • 1
  • 9