Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Ranorex Spy, Recorder, and Studio.
roneil
Posts: 19
Joined: Wed Sep 07, 2011 3:59 pm

Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by roneil » Wed Sep 07, 2011 4:50 pm

We cannot use Ranorex Studio to debug scripts compiled as "AnyCPU" on Windows 7 SP1 x64 systems.

We can debug scripts compiled as x86, but an error is reported as soon as the debugger is launched once the script is modified to compile as 'Any processor':
Debugger error:
HR = 0x80131C30
Code = 0x0

Debugging 64-bit processes is currently not supported.
If you are running a 64-bit system, this setting might help:
Project -> project Options -> Compiling -> Target CPU = 32-bit Intel
We tried installing .NET 4.0 (extended client profile) and adding app.config files as indicated in another thread and in the user guide (general troubleshooting - http://www.ranorex.com/support/user-gui ... oting.html):

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>
But this caused an exception instead of an error message:
Can not start process. The request is not supported. (Exception from HRESULT: 0x80070032)
The problem only seems to affect debugging; the scripts execute fine in Ranorex Studio when executed with ‘Run without debugging’ or executed directly or by batch file outside of Ranorex Studio.

Our AUT is a client-server application that is compiled as 'AnyCPU'. The client application is used on XP SP3 (x32) and Win7 SP1 (x32) systems. The same executables are used on Windows Server 2008 Datacenter (x64) to support web services. Our backend server is Windows Server 2008 (x64) with an Oracle 11gR2 (v11.2.0.1.0) database.

The AUT can also be configured for stand-alone operations, where the client software and database are both installed on a end-user system. While end-user and client systems are currently XP SP3 (x32) and/or Win 7 (x32), plans do exist to allow Win 7 x64 clients and stand-alones in the near future.

Our tests interact with the database to do lookup queries and the like. Our test development systems are configured as clients to a common database server. The database access is managed by an installed Oracle Data Access Client (ODAC). The x64 ODAC is installed on x64 systems and the x32 ODAC is installed on x32 systems.

The AUT won't work with the wrong ODAC installed (i.e., x32 on a x64 system) and the test scripts accessing the database receive Oracle Type Mismatch errors when compiled as x86 on x64 systems with the x64 ODAC. Thus our scripts must be compiled as "AnyCPU" to properly interact with the ODAC version installed on any system running the tests and the AUT.

We tried converting to the scripts to use .NET 3.5, but with no change in results.

We tried upgrading Ranorex to 3.0.5 and then 3.1.0, but again with no change in results.

Are there configuration setting we need to set in our test library, are there settings in Ranorex Studio that should be set, or are we unable to use Ranorex Studio to debug scripts on x64 systems when compiled as "AnyCPU"?

A work-around allows debugging the scripts using VS2008, but only when the scripts' app.config file is modified so that the "<supportedRuntime version="v4.0"/>" line is removed or commented out:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <!-- <supportedRuntime version="v4.0"/> -->
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>
Unfortunately, not all of our test developers have VS 2008. In addition, this is less productive than debugging directly from Ranorex Studio.

We have managed to reproduce the issue by creating a script that executes operations on the Windows Calculator. The results match what we're seeing in our AUT scripts, even though no database access occurs.

The attached ZIP file contains four versions of the TestCalc2 script:

TestCalc2
This is the original script folders and files that launches calculator, runs some calculations, then exits. Built as .NET 2.0 and x86, this version can be debugged within Ranorex Studio.

TestCalc2 - .NET 3.5
‘TestCalc2’ modified to use .NET 3.5, but still compiled as x86 – this version can still be debugged within Ranorex Studio.

TestCalc2 – AnyCPU
‘TestCalc2’ modified to compile as AnyCPU, but still target for .NET 2.0 – this version cannot be debugged in Ranorex Studio – nor in VS2008.

TestCalc2 - AnyCPU -VS2008
‘TestCalc2 – AnyCPU’ with the app.config file modified to allow debugging in VS2008 (but not Ranorex Studio).

A snapshot of the Calculator application has also been attached.
Attachments
TestCalc2 rxsnp.zip
Calculator snapshot
(341.75 KiB) Downloaded 188 times
TestCalc2.zip
examples of issue
(941.46 KiB) Downloaded 193 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by Support Team » Thu Sep 08, 2011 2:13 pm

Hi,
We can debug scripts compiled as x86, but an error is reported as soon as the debugger is launched once the script is modified to compile as 'Any processor':
This is unfortunately a known issue but it will be fixed in the next major release.
A work-around allows debugging the scripts using VS2008
At the moment this is the only workaround.
Thank you for the example and the good explanation of the issue.

Regards,
Markus
Ranorex Support Team
.
Image

roneil
Posts: 19
Joined: Wed Sep 07, 2011 3:59 pm

Re: Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by roneil » Thu Sep 08, 2011 3:54 pm

Will the 'next major release' be version 3.1.1, 3.2.0, 4.0, or something else?

Do you have any idea how long before this fix would be available?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by Support Team » Thu Sep 08, 2011 4:02 pm

Hi,

The next major release will be version 3.2 and will come in the fourth quarter of 2011.

Regards,
Markus
Ranorex Support Team
.
Image

roneil
Posts: 19
Joined: Wed Sep 07, 2011 3:59 pm

Re: Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by roneil » Thu Sep 08, 2011 5:32 pm

Thank You.

roneil
Posts: 19
Joined: Wed Sep 07, 2011 3:59 pm

Re: Cannot debug scripts compiled as ‘AnyCPU’ on Win7 x64

Post by roneil » Fri Feb 10, 2012 12:08 am

We can now debug scripts on Win 7 x64 using Ranorex Studio versions 3.2.0 and 3.2.1.

Thank You.