User code collection - Namespace name could not be found

Ask general questions here.
alexlosk
Posts: 9
Joined: Tue Oct 17, 2017 10:18 am

User code collection - Namespace name could not be found

Post by alexlosk » Wed Jul 18, 2018 8:58 am

Hi all,

I am trying to include an user code collection in my 'Ranorex Automation Helper' section.
usc1.png
usc1.png (11.63 KiB) Viewed 186 times
But when I create my UserCodeMethod I am not able to access to the repository of my solution and ranorex gives me this error:

The type or namespace name 'AutomationFinance' could not be found (are you missing a using directive or an assembly reference?) (CS0246)

I've tried to include right after my 'Public class Section Validations' to define the repo (highlighted in red in the screenshot) but it does not work.
Could any of you help me to fix this issue?
usc3.png
usc3.png (80.02 KiB) Viewed 186 times

dpFourOFour
Certified Professional
Certified Professional
Posts: 38
Joined: Mon Dec 12, 2016 9:24 am

Re: User code collection - Namespace name could not be found

Post by dpFourOFour » Thu Jul 19, 2018 1:36 pm

Hi alexlosk,

To access the repository within your usercode collection, you need to reference the project that contains the repository.
You can do this by selecting 'add reference' from the context menu (right click the 'References' entry in your automationhelper project).
In the upcoming dialog, you need to select the 'projects' tab and your project that contains the repository.
Next step is to add the 'using' directive to your automationhelper project.
using AutomationFinance;
Now you should be able to access the repo.

Hope that helps,

DP
Please always include the following information to your posts
  • Ranorex Version
  • OS Version

alexlosk
Posts: 9
Joined: Tue Oct 17, 2017 10:18 am

Re: User code collection - Namespace name could not be found

Post by alexlosk » Thu Jul 19, 2018 2:15 pm

It works!!!! :D :D thanks so much !