Page 1 of 1

Cannot change the Target CPU when Platform is AnyCPU

Posted: Thu Sep 08, 2011 7:18 pm
by roneil
Changing the Target CPU in a project’s Compiling properties isn't saved when Platform is “AnyCPU”. The process works correctly when the Platform is “x86”.

1. Open a Ranorex solution set to use the “x86” platform and with target CPU set as “32-bit Intel-compatible processor”.
2. Open the Configuration Editor (Build -> Edit configurations/platforms).
3. Select the Platform pull-down and click “<Edit>”.
4. Click Add… and define the “AnyCPU” solution platform. Do not copy settings. Select to create in all projects.
5. Click OK then Close.
6. Change Platform to “AnyCPU”; the project platform changes to match.
7. Set AnyCPU as the current platform with Build -> Set Platform -> AnyCPU
8. Click Build -> Rebuild Solution
9. Right-click a project and click ‘Properties’
10. Switch to the Compiling tab – note that Platform is AnyCPU but Target CPU is still “32-bit Intel- compatible processor”
11. Change the Target CPU value from “32-bit Intel-compatible processor” to “Any processor”
12. Save the changes when closing the Properties sheet
13. Rebuild the solution (Build -> Rebuild Solution)
14. Reopen the project’s Compiling Properties tab – the Target CPU value has reverted to its original value

The work-around is to manually edit the CSPROJ file for that project with a text editor (Notepad, etc.):

1. Change the Platform in the PropertyGroup containing the project GUID – this defines the default or current platform (which should have happened when Build -> Set Platform -> AnyCPU was clicked)
2. Likewise update any PropertyGroup where the Platform is “AnyCPU” and the Platform Target is “x86”.
3. Repeat as needed for all projects within the Ranorex solution
4. Reopen Ranorex Studio and examine the Compiler Properties for the project – note that the Target CPU has changed to “Any processor”

Similar issues occur when removing an unwanted x86 configuration… these work-around steps can be combined with those for that issue.

We have verified this issue exists for Ranorex Studio versions 3.01, 3.03, 3.04, 3.05, and 3.1.0 on Windows 7 SP1 x64. VS2008 is installed, as well as .NET 3.5.1 and .NET 4.0 (client profile).

Re: Cannot change the Target CPU when Platform is AnyCPU

Posted: Fri Sep 09, 2011 1:02 pm
by Support Team
Hi,

Thanks for reporting this issue!
It looks like it might be a bug, we will look into it.

Regards,
Markus
Ranorex Support Team

Re: Cannot change the Target CPU when Platform is AnyCPU

Posted: Tue Nov 08, 2011 5:59 pm
by Support Team
We fixed that issue with the upcoming maintenance release Ranorex 3.1.2.

The problem was caused by the space (or the absence of it) in "Any CPU" - the solution files needs a space in it whereas in the project file the platform must not contain a space. And this conversion was not always done, ending up in wrong platforms being written to the project file :?

Regards,
Alex
Ranorex Team

Re: Cannot change the Target CPU when Platform is AnyCPU

Posted: Fri Feb 10, 2012 12:06 am
by roneil
We have verified that this issue is fixed in versions 3.1.3, 3.2.0, and 3.2.1.

Thank You.