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

3

13

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.

Tadd answered 29/3, 2012 at 23:54 Comment(3)
Just to clarify, you're looking at the configuration manager and not the configuration drop down, correct?Crabbing
There should be "<New ...>" item, that allows to add new ANY CPU configuration.Microspore
I will add the answers to your questions in my question.Tadd
R
13

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

Reimpression answered 30/3, 2012 at 0:3 Comment(5)
Right. I didn't feel like explaining it all.Dehydrate
If I do that I get the error: This platform could not be created because a solution platform of the same name already exists.Tadd
Suddenly it seems to work (after closing the window and trying it again). Don't have a clue why it did not work the first time but my problem is solved. Thanks for the answer.Tadd
I upvoted because of the other way of reaching the configuration manager which may have helped.Tadd
there is no option to copy from x64.Rhizobium
D
22

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.

Davies answered 2/11, 2012 at 3:23 Comment(1)
Yep, this is the real answerArgumentation
R
13

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

Reimpression answered 30/3, 2012 at 0:3 Comment(5)
Right. I didn't feel like explaining it all.Dehydrate
If I do that I get the error: This platform could not be created because a solution platform of the same name already exists.Tadd
Suddenly it seems to work (after closing the window and trying it again). Don't have a clue why it did not work the first time but my problem is solved. Thanks for the answer.Tadd
I upvoted because of the other way of reaching the configuration manager which may have helped.Tadd
there is no option to copy from x64.Rhizobium
Q
1

In my experience with Visual Studio 2010, AnyCPU is not a pre-defined option for WinForms projects (I've never checked WPF so i don't know if it is the same there).

If you select x86, it will run on an x64 machine, so that is the safest bet without adding Any CPU to the configuration manager.

Queridas answered 30/3, 2012 at 0:2 Comment(1)
Suddenly I could add the option agaion (see comment at other answer). THanks for helping. I upvoted because of the tip for x86.Tadd

© 2022 - 2024 — McMap. All rights reserved.