New Project: Many Ranorex-DLLs are copied to outputfolder in 10.1.6, changing to 64bit not possible

Bug reports.
User avatar
Patrick Hollerbach
Posts: 34
Joined: Thu Jan 02, 2014 4:00 pm
Location: Frankurt, Germany

New Project: Many Ranorex-DLLs are copied to outputfolder in 10.1.6, changing to 64bit not possible

Post by Patrick Hollerbach » Wed Feb 23, 2022 6:00 am

When creating a new solution with Ranorex 10.1.1 (and older versions), the build produces 8 files in the debug-folder:
Old_RxVersion.png
When creating a new solution with Ranorex 10.1.6, the bbuild produces 89 files in the debug folder:
New_RxVersion.png
I figured out that in the new solution created with 10.1.6 the property „Local copy“ for the referenced ranorex assamblies is set to „True“ (in new project created with 10.1.1 it is „False“).
Properties.png
When I change the target cpu to "Any processor (prefer 64-bit) the project compiles, but it throws an execution at runtime with following stack trace:
----------------------------------------------------------------------------------------------
System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.BadImageFormatException: Die Datei oder Assembly "Ranorex.Core.WinApi, Version=10.1.6.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a" oder eine Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.
bei Ranorex.Keyboard.UpdateLowLevelKeyboardHookCallback()
bei Ranorex.Keyboard.set_PauseKey(Keys value)
bei Ranorex.Keyboard.set_AbortKey(Keys value)
bei EmptyDemo.Program.Main(String[] args) in C:\Ranorex\projects\EmptyDemo\EmptyDemo\Program.cs:Zeile 34.
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei Ranorex.Core.Resolver.MainInvoker.Invoke(Assembly callerAssembly, String startUpObject, String[] args)
bei __RxMain.__RxProgram.Main(String[] args) in C:\Ranorex\projects\EmptyDemo\EmptyDemo\obj\Debug\__RxPrograms.g.cs:Zeile 32.

Test executable crashed with unhandled exception.
Please ensure all required prerequisites are installed:
- .Net Framework 4.5
- VC++ Redistributable (2017)

When I change the property "local copy" for all ranorex references except Ranorex.Core.Resolver to „False“, everything works without problems.

The core problem is the wrong property „Local copy“ in a new created solution or project.

I already reported this issue to ranorex support a week ago, but got no feedback.
Can anyone confirm this issue?

Regards
Patrick
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: New Project: Many Ranorex-DLLs are copied to outputfolder in 10.1.6, changing to 64bit not possible

Post by odklizec » Wed Feb 23, 2022 9:33 am

Hi Patrick,

I just tried to compile multiple projects with "Any processor (prefer 64-bit)" and there is no exception thrown.

I can't comment the reason why the reference files are not copied to output dir. But the error message you are getting about .Net Framework 4.5 is definitely wrong, because Ranorex 10.x requires .Net 4.8.

However, the TargetInvocationException exception you are getting sounds familiar to me. I guess you are using Windows 11? There is a known issue with Ranorex compatibility with Windows 11. But I'm afraid, I don't know when this issue will be solved.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration