Can't change target platform to "any CPU"

I work on an x86 pc and use .NET4.0 (same probelem with 3.5) in VS2010. When I make a new Project (eg 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?


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.


To change target platform do the following:

[1.] Open the configuration manager

[2.] In platforms, select new.

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

source: ericklan.com


You can proceed as follow to configure the target platform:

  • In Visual Studio, right click on the solutionSelect "Properties"
  • A setting dialog will appear
  • Click on configuration Settings: You will see all the projects of the solution and the configation of the compilation.
  • Click on "Configuration Manager" button (top right of the dialog)
  • You will see two dropdowns, click on the "Target Platform" one and then on "New" in order to add the the desired target platforms
  • Once the desired target platforms added, choose the one that you want
  • Click close then Ok
  • 链接地址: http://www.djcxy.com/p/75126.html

    上一篇: C#编译为32/64位,或任何CPU?

    下一篇: 无法将目标平台更改为“任何CPU”