Search code examples
c#visual-studio-2010configurationmanageranycpu

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.


Solution

  • 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