Error when running project via Agent in Azure Devops

Ask general questions here.
sandervb
Posts: 1
Joined: Wed Oct 20, 2021 10:52 am

Error when running project via Agent in Azure Devops

Post by sandervb » Wed Oct 20, 2021 10:58 am

Hi everyone,

We are having some issues with running a project of ours via Azure Devops (Agent 2019 installed).
Whenever we start the queue, we get the following error message when executing the step
"Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe":

error CS1729: 'Ranorex.Core.Repository.RepoItemInfo' does not contain a constructor that takes 7 arguments [C:\Agent2019\_work\2\s\Fnice\Fnice.csproj]

We are not having this issue with other projects, so I presume this is code related, but the project itself is launching without issues in Ranorex. Only when we want to run it in Azure via the agent, it fails.

Any ideas?
Thanks in advance,

Sander

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

Re: Error when running project via Agent in Azure Devops

Post by odklizec » Fri Oct 22, 2021 8:02 am

Hi,

My guess is, that there is something wrong with the solution on azure machine (make sure that the code downloaded from source control, is the same as code on your local machine) or the Azure machine you are building on does not have all required libs? Have you actually tried to install whole Studio on that Azure machine and load and build the failing solution with Studio?
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

johnmalib
Posts: 1
Joined: Mon Jul 18, 2022 7:03 am

Re: Error when running project via Agent in Azure Devops

Post by johnmalib » Mon Jul 18, 2022 7:04 am

When you provided a constructor for your class that takes arguments, the compiler no longer creates an empty constructor. Therefore, you cannot call an empty constructor because it does not exist. You would need to explicitly write the constructor that takes 0 arguments in your class's code. The constructor of the inheritance class needs to construct the base class first. since the base class does not have a default constructor (taking 0 arguments) and you are not using the non-default constructor you have now, this won't work. so either:

Add a default constructor to your base class, in which case the code of the descending class needs no change;

Or

Call the non-default constructor of the base class from the constructor of the descending class, in which case the base class needs no change.