Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I do not have a 'Any CPU' option present in my Configuration Manager

I have read several posts about the configuration manager in VS2010 (or before) but I can not find my problem.

I have a solution containing 6 projects. When I open the Configuration manager, I can select: 'Active Solution Configuration' with values Debug, Release, New or Edit. Áctive Solution Platform' with values Any CPU, Mixed platforms, x64, x86, New or Edit. And for any of my 6 projects the configuration (Debug, Release, New, Edit), Platform (non startup projects: Any CPU, New, Edit and startup project: x64, New, Edit).

For all projects except the startup project the only (real) choice for Platform is 'Any CPU', which I think is fine.

However, for the startup project I only can select x64 so I assume running it on 32 bit Windows OS's will be a problem?

I have played in history a bit with the values and now somebody mailed me this error he gets:

the version of this file is not compatible with the version of Windows you're running. Check your computers system information to see whether you need an x86(32-bit) or x64 ( 64bit ) version of the program, and then contact the software publisher

(also when I select the x86 platform I only can select x64 as platform in my startup project, while others are set to 'Any CPU'.

When trying to add Any CPU to the startup project, I can select it but it asks to copy the settings and I only can select x64 or empty. Selecting either of them results in the error:

This platform could not be created because a solution platform of the same name already exists.

I assume it was previously set to x86 but I'm not sure, anyhow, how can I get the 'Any CPU' selection back for my startup project?

UPDATE: SUDDENLY I COULD ADD THE OPTION 'ANY CPU' WITHOUT GETTING AN ERROR. So my problem is solved ...

I only don't know why it didn't work the first time ... I just closed the window and started it again and it was possible.

like image 359
Michel Keijzers Avatar asked Mar 29 '12 23:03

Michel Keijzers


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.

What is platform in Visual Studio?

Visual Studio enables you to set up your application builds to target different platforms (processor architectures), including Arm64 and other platforms. You don't need to be running Visual Studio on a platform in order to build for that target platform.


2 Answers

The real answer is, you need to uncheck the "Create new solution platforms" checkbox on the New Project Platform dialog, because you don't need to create the solution platform, just the project platform. That is what the error message was trying to tell you:

This platform could not be created because a solution platform of the same name already exists.

I confess I also totally overlooked that checkbox more times than I care to admit. Why Microsoft can't just avoid creating the duplicate solution platform silently instead of showing an error, I'll never know.

like image 108
PolyTekPatrick Avatar answered Sep 29 '22 01:09

PolyTekPatrick


You can add the platform back in the solution configuration manager.

Right-click solution -> Properties... -> Configuration -> click "Configuration Manager..."

Now the problem project's platform says "x64". click its drop-down arrow, New..., Any CPU - copy from x64.

Uncheck the "Create new solution platforms" checkbox on the New Project Platform dialog

like image 40
Jonathan Avatar answered Sep 28 '22 23:09

Jonathan