Page 1 of 1

Ranorex does not run within VS2008 Unit Test

Posted: Tue Aug 18, 2009 7:15 am
by mikeerh
I am evaluating Ranorex for our company (Capgemini sd&m) and it is now the second major issue I detected since yesterday. (yesterday I had crashes in Ranorex studio while stepping through code -> see other bug report.
We use Visual Studio 2008 Prof. and we are using the new UNIT Test feature, which is great because it replaces the need to take NUNIT as external tool. It allows to execute and single step through unit test within Studio
The problem is: I am not able to run any (even simplest) sample within VS2008 if the (Ranorex)-code is executed from a VS2008 Unittest.
If I run the same code within a normal C# console VS2008 project --> no problem!!

I tried the sample on two different machines and they threw two different exceptions
on one this box pops up when the first call to a Ranorex-function is issued: " run time library exception R6034 - an application has made an attempt to load the C runtime incorrectly"

On the other PC the standard exception catch block is called during first Ranorex statement with the error "Type initialisation exception occured", with callstack:

bei System.Runtime.CompilerServices.RuntimeHelpers.PrepareDelegate(Delegate d)
bei System.AppDomain.add_ProcessExit(EventHandler value)
bei Ranorex.Core.ElementEngine..ctor()
bei Ranorex.Core.ElementEngine.get_Instance()
bei Ranorex.Host.get_Local()
bei TestRanorex1.UnitTest1.TestMethod1() in C:\Dokumente und Einstellungen\mike\Eigene Dateien\Visual Studio 2008\Projects\TestRanorex\TestRanorex1\UnitTest1.cs:Zeile 74.

I could provide you more information, the solutions ..
Until these problems are not solved I cannot recommend using Ranorex in our company

Re: Ranorex does not run within VS2008 Unit Test

Posted: Tue Aug 18, 2009 8:34 am
by Support Team
The exception message looks like the right "Visual C++ 2005 Redistributable Package" is not installed that should be installed by the Ranorex setup. However, if that is true, the normal C# console application should fail, too. Anyway, could you please try to repair your Ranorex installation from the "Add or Remove Programs" dialog in the Windows Control Panel?

I just tried to reproduce that error with Visual Studio 2008 (Version 9.0.30729.1 SP), but did not succeed - Ranorex was just running as it should (VS 2008 Unit testing with Ranorex is used by several customers). Could you please post your exact Visual Studio Version?
And could you provide us your solution/project files, maybe we can reproduce that error that way? Please send those files to support_at_ranorex.com! Thanks!

Regards,
Alex
Ranorex Support Team

Re: Ranorex does not run within VS2008 Unit Test

Posted: Tue Aug 18, 2009 11:47 am
by mikeerh
I did the verify install of Ranorex / I restarted -> no change

our VS version is Visual Studion Team System 2008 9.0.21022.8 RTM

I sent the solution to Ranorex Support

Re: Ranorex does not run within VS2008 Unit Test

Posted: Wed Aug 19, 2009 9:13 am
by Support Team
It seems that VS 2008 RTM's unit testing has problems when a unit test binds to a different version of the Microsoft CRT than itself does. That problem does not seem to exist with VS 2008 SP1. Could you please try to update to the latest VS 2008 SP1? You can download the setup from the following URL:
http://www.microsoft.com/downloads/deta ... laylang=en

Regards,
Alex
Ranorex Support Team

Re: Ranorex does not run within VS2008 Unit Test

Posted: Wed Aug 19, 2009 11:26 am
by mikeerh
Thats it -> I just upgraded to VS2008 SP1 and it runs perfect
Thank you