References and dependencies not solved correctly

Bug reports.
ContiChris
Posts: 7
Joined: Tue Jun 01, 2021 8:56 am

References and dependencies not solved correctly

Post by ContiChris » Fri Jun 18, 2021 6:34 am

Referring to the post References are not working properly with structured project/solution setup I am providing a example solution which shows the problem. I deleted all the bin- and obj-folders. So, trying to build the solution .\test\main\src\ExampleTest.rxsln with Ranorex will fail with the following errors:

Code: Select all

Metadata file 'C:\Users\uid01796\Desktop\00895315\Example\common\AutomationHelpers\bin\Debug\AutomationHelpers.dll' could not be found (CS0006)
Warning - Action #1: The default value of the variable bound to 'File name' is empty. Provide a valid file name to run. - C:\Users\uid01796\Desktop\00895315\Example\common\rx_modules\example\src\gui_modules\startApp.rxrec:1
Error - Action #1: Method "  AutomationHelpers.UserCodeCollections.FileLibrary.DeleteFiles(System.String path, System.String pattern) " does not exist. Select a different method or add it to the user code. - C:\Users\uid01796\Desktop\00895315\Example\common\rx_modules\example\src\modules\CleanupCustomerDB.rxrec:1
Error - Action #1: Method "  AutomationHelpers.UserCodeCollections.FileLibrary.CopyFile(System.String srcFile, System.String destFile) " does not exist. Select a different method or add it to the user code. - C:\Users\uid01796\Desktop\00895315\Example\common\rx_modules\example\src\modules\CopyResource.rxrec:1
Instead building the VisualStudio-solution-file .\test\main\src\ExampleTest.sln with msbuild works without any problem.
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: References and dependencies not solved correctly

Post by odklizec » Fri Jun 18, 2021 8:38 am

Hi,

Thanks for the sample solution.

I may be missing something obvious, but the whole problem seems to be in the fact, that the AutomationHelpers are not a part of the solution? Adding AutomationHelpers and adapting references in both projects fixed the problem. See the updated example...
AutomationHelpers.png
ExampleTest.zip
You do not have the required permissions to view the files attached to this post.
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

ContiChris
Posts: 7
Joined: Tue Jun 01, 2021 8:56 am

Re: References and dependencies not solved correctly

Post by ContiChris » Fri Jun 18, 2021 10:03 am

Hi
@odklizec: Thank you for your help. It is working like you suggested.

Nevertheless I think it is not obvious to do it like this.
In my opinion there are missing a few examples from Ranorex how to structure projects and how is the building/dependency-solving process.
For me, your solution is a workaround but the overall topic still treated as a bug.

Thanks again.

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

Re: References and dependencies not solved correctly

Post by odklizec » Fri Jun 18, 2021 10:12 am

Hi,

Well, I don't think it's a bug. I believe it's a common behavior in a .net programing word?

If you don't want to include code of common libs in your project, you can, of course, add a pre-compiled dlls to the project and make them to copy to output directory during build. Eventually, you can create and use nuget package? The solution I provided is the most obvious one and something I personally prefer. I just want the ability to edit common libs on fly, from whatever project I'm currently working on ;)
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