Exception After Using External DLL

Bug reports.
adam.laguardia
Posts: 2
Joined: Fri Jan 06, 2023 3:40 pm

Exception After Using External DLL

Post by adam.laguardia » Fri Feb 24, 2023 11:46 pm

I was able to implement using a universal bus as described in this viewtopic.php?t=20243 post.

In the Mobile App test Automation project we are using, the test flow is as follows:

Start Mobile App->Perform UI Functions->Perform Universal Bus functions->Perform more UI Functions->Close Mobile App

When performing universal bus functions, the steps are as follows:

setup universal bus driver -> send applicable universal bus command -> close universal bus driver

When performing the test, the mobile app is started, UI functions are performed, Universal Bus functions are performed, and then after at random points while either performing further UI functions an unhandled System.ExecutionEngineException is thrown. The top of the stack trace says it is at static System.Void System.GC.AddMemoryPressure(System.Int64 bytesAllocated).

Thanks in advance,
Adam

adam.laguardia
Posts: 2
Joined: Fri Jan 06, 2023 3:40 pm

Re: Exception After Using External DLL

Post by adam.laguardia » Mon Mar 06, 2023 9:37 pm

An update and helpful hint to those trying to implement unmanaged DLLs with Ranorex. I was able to resolve this issue by allocating larger return arrays in my Ranorex project for data coming back from the external DLL. We usually don't have to worry much about memory allocation when programming in C#, but need to be cognizant when functions in external DLLs we call to are returning more data that we originally planned for in our Ranorex project.