Question

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.

Was it helpful?

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top