Page 1 of 1

Ranorex 6.1.1 and .Net 4.5.2

Posted: Thu May 04, 2017 11:54 am
by MarkF
I've got a fresh install of Ranorex 6.1.1 (I had the same issue earlier, uninstalled Ranorex, reboot, download 6.1.1. and install again, but no change).

Creating a new Test Suite solution, builds and runs fine without any changes.

Go to the new project properties, target framework is defaulted at 4.0. Convert to .Net 4.5.2 (this is the framework of the application I'll be testing, so I assume this has to match or be greater).

Solution/project still builds without any errors/warnings, but when I try to run with the debugger on, it quits immediately (adding a breakpoint to first line in the Program.Main function doesn't break). Without debugger, it, a window appears starting "<RanorexProject> has stopped working". If I try to debug the project in Visual Studio it states that the error is 'System.BadImageFormatException'. This doesn't give much more detail;

System.BadImageFormatException was unhandled
Message: An unhandled exception of type 'System.BadImageFormatException' occurred in Unknown Module.
Additional information: Could not load file or assembly 'Net52Test.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.


Is there any other changes/steps I need to do before I can use 4.5.2, or does 6.1.1 not work with 4.5.2? My Ranorex license only allows me to use 6.1.1 and no newer.

Re: Ranorex 6.1.1 and .Net 4.5.2

Posted: Thu May 04, 2017 12:11 pm
by MarkF
Okay, checking the release notes looks like this was fixed in 6.2.0 released Nov 2016, but our license only goes up to Oct 2016...

https://www.ranorex.com/release-notes.html#c14024


Short of renewing our license, is there any workaround?

Re: Ranorex 6.1.1 and .Net 4.5.2

Posted: Thu May 04, 2017 4:18 pm
by krstcs
No, there is no workaround for the specific issue as it was a bug in Ranorex.

However, you do not have to have Ranorex compiled at the same .NET version level as your SUT unless there are libraries from your SUT that you are including in the Ranorex test solution, which you shouldn't do as that can cause issues with test consistency. The test should not depend on the SUT's code. However, Ranorex doesn't care what .NET version it is testing against, as long as it can identify elements you are good to go.


Also, you should keep your license up-to-date. Ranorex tends to only support that latest 2 feature releases (6.2.X and 7.0.X currently) with bug fixes, so, if you don't keep your license you can be stuck with bugs and old features that aren't getting fixed anymore. They make a great product and the license helps make sure they can keep making it.

Re: Ranorex 6.1.1 and .Net 4.5.2

Posted: Fri May 12, 2017 12:10 pm
by MarkF
Found what the problem was. In the app.config, after doing the conversion to 4.5.2, is this line;

<supportedRuntime version="v4.0" sku=".NETFramework,Version=4.5.2" />

The problem is the missing 'v' before the version number, so this should be;

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />