100

I work on an x86 pc and use .NET4.0 (same probelem with 3.5) in VS2010. When I make a new Project (e.g. WinFormsApp), the first thing I want to do is to change the target platform of the project/solution to "Any CPU".

I do the following:

Project Properties -> build -> change TargetPlatform to "Any CPU"

On top of the properties page the platform is still "Active (x86)", so I do

Solution Properties -> ConfigurationsMgr -> Platform -> new (since nothing but x86 is available) and create the solution platform "Any CPU".

Now the project properties are "Active (Any CPU)" and I can change it back and forth as I like.

And now the Problem: When I add a new Project, it is again set to "Active (x86)" and I -again - can't change the project settings. In the SolutionProperties -> ConfigurationManager for this second project, the "Any CPU" platform is not available and I can't add a new one, since it tells me that a solution platform for AnyCPU is already there...

What am I doing wrong? Can it be so hard to set a newly created project to AnyCPU?

Spontifixus
  • 6,570
  • 9
  • 45
  • 63
Martin Booka Weser
  • 3,192
  • 5
  • 28
  • 41

3 Answers3

142

In the configuration Manager, you can add a new platform for your project. However, you need to uncheck the "Create new solution platforms" if you already added the platform for your solution, otherwise you will indeed get the warning that the solution platform is already there.

Edwin de Koning
  • 14,209
  • 7
  • 56
  • 74
  • 4
    Don't quite understand why, but also don't quite understand why i didn't try that. However, thats the answer to my problem. But seriously, i should have never ever switched the language to german. Translations are horrible... – Martin Booka Weser Oct 25 '10 at 13:37
  • Unchecking "Create new solution platforms" did the job. Thanks! +1 – Fka Dec 13 '16 at 08:17
  • What do you do if you cannot add an "Any CPU"? – Doug Kimzey Jun 21 '17 at 20:26
66

To change target platform do the following:

[1.] Open the configuration manager

enter image description here

[2.] In platforms, select new.

enter image description here

[3.] New platform select x64 or you need, in "copy settings from" select "Any CPU" or "Empty", and uncheck the "Create new solution platforms"

enter image description here

source: ericklan.com

RckLN
  • 4,272
  • 4
  • 30
  • 34
  • 1
    I don't have the option "New". I only see x86 and Edit. Any ideas? – Kris Oct 02 '15 at 02:39
  • 3
    Pictures help improve the quality of post like anything. +1. – RBT Feb 07 '17 at 07:00
  • If the new platform isn't available after following the steps above (anytime I changed the platform it reverted back to the original platform and the new platform was no longer available in the dropdown) - try removing the project from the solution then adding the project back into the solution. The steps above should then work. – teej Jul 23 '23 at 15:35
4

You can proceed as follow to configure the target platform:

  1. In Visual Studio, right click on the solutionSelect "Properties"
  2. A setting dialog will appear
  3. Click on configuration Settings: You will see all the projects of the solution and the configation of the compilation.
  4. Click on "Configuration Manager" button (top right of the dialog)
  5. You will see two dropdowns, click on the "Target Platform" one and then on "New" in order to add the the desired target platforms
  6. Once the desired target platforms added, choose the one that you want
  7. Click close then Ok