Ranorex Report to PDF through Code - Could not load file

Class library usage, coding and language questions.
SteveBeck
Posts: 19
Joined: Thu Jul 27, 2017 8:27 am

Ranorex Report to PDF through Code - Could not load file

Post by SteveBeck » Wed Jan 17, 2018 1:55 pm

Hi all,

I am currently running my Ranorex tests through Jenkins and Nunit, at the end of my test my framework uses the Ranorex Automation Helper to convert the report into a PDF. The problem I am experiencing is that after running on the Jenkins Nodes instead of generating the PDF report I get the following error:
ReportToPDF: Could not load file or assembly 'Ranorex.PDF, Version=1.0.12.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I thought it might be due to the automation helper being in a seperate assembly, so I Integrated it into the same assembly but this has not solved the problem.

** The Report to PDF script is unchanged, and I used package management to add the Ranorex library

SteveBeck
Posts: 19
Joined: Thu Jul 27, 2017 8:27 am

Re: Ranorex Report to PDF through Code - Could not load file

Post by SteveBeck » Thu Jan 18, 2018 6:56 am

In trying to fix this I found a much more frustrating experience. I had not upgraded my Nodes to Ranorex v8.0.
After doing, Ranorex stopped finding the Ranorex libraries. I dont know why, but Ranorex on the nodes does not seem to look for/find the Ranorex dlls. Then I set the References to create local copies (but due to a bug which does not seem to be being fixed, this change is undone whenever Ranorex reloads), even so all the required dlls are not referenced in the project, so the test would start, and then not interact with anything.

My current solution has been to copy the contents of the Ranorex bin folder and dump it into my built project.

I read that Ranorex v8.0 is now supposed to package these into the build by itself, I am not seeing this. Is there a guide on how to ensure that Ranorex will package the required libraries into a build?

ahoisl
Certified Professional
Certified Professional
Posts: 192
Joined: Fri Sep 07, 2007 8:16 am

Re: Ranorex Report to PDF through Code - Could not load file

Post by ahoisl » Thu Jan 18, 2018 9:29 am

SteveBeck wrote:The problem I am experiencing is that after running on the Jenkins Nodes instead of generating the PDF report I get the following error
Make sure the Ranorex.PDF reference has the "Copy to output" property set and that it is present in the same folder as your test suite executable.
And another shot in the dark: we experienced the Ranorex.PDF assembly being falsely identified as a virus by an AV engine. Can you check if an AV engine possibly put the file into quarantine?
SteveBeck wrote:I read that Ranorex v8.0 is now supposed to package these into the build by itself, I am not seeing this. Is there a guide on how to ensure that Ranorex will package the required libraries into a build?
The recommended way is still to install Ranorex on each client.

For the new options, see the this forum thread for more information:
https://www.ranorex.com/forum/how-to-us ... 11671.html
And you might also want to read the XCOPY deployment chapter in the user guide:
https://www.ranorex.com/help/latest/xcopy-deployment

Regards,
Alex
Ranorex Team

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report to PDF through Code - Could not load file

Post by Support Team » Thu Jan 18, 2018 10:59 am

Hello,

This is actually a bug within Ranorex 8.0.

Please find further information here: unable-to-convert-report-to-pdf-with-ra ... 11741.html

Sincerely,
Robert