Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (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?

like image 372
Martin Booka Weser Avatar asked Oct 25 '10 07:10

Martin Booka Weser


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

What is active solution platform?

The Active Solution Platform allows you to configure a specific combination of configurations for each project. The Project Platform allows you to make specific configuration settings for a project.


1 Answers

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.

like image 171
Edwin de Koning Avatar answered Oct 02 '22 15:10

Edwin de Koning