Problems adding reference to Ranorex project.

Ask general questions here.
MarkF
Posts: 10
Joined: Fri Jan 29, 2016 3:31 pm

Problems adding reference to Ranorex project.

Post by MarkF » Tue May 02, 2017 5:23 pm

I'm not able to add a reference to a Ranorex project. It's a C# library and it builds fine in Visual Studio 2015, targeting .NET 4.5.2.

In Ranorex Studio 6.1.1 (the most recent version permitted by my license) when I try adding the reference using the .NET Assembly Browser, selecting the output DLL file in the Visual Studio bin\Debug folder, it appears under references for the Ranorex project (also targeting .NET 4.5.2). However it is not able to resolve any namespaces/classes from the referenced library. This warning also appears;

The primary reference <Referenced Library> could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Diagnostics.Tracing, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "4.0.20.0" than the version "4.0.10.0" in the current target framework. (MSB3258)

Except the library uses System.Diagnostics.Tracing version 4.3.0, not 4.0.20.0, so this is wrong.

qwertzu
Posts: 179
Joined: Wed Jan 25, 2017 11:08 am

Re: Problems adding reference to Ranorex project.

Post by qwertzu » Wed May 03, 2017 1:25 pm

Hi,

Without taking a look at your application, I can only suggest the following steps:
  • please check again whether the target framework within Ranorex Studio is really set to 4.5.2. (Within the "Compiling" tab of your Projects properties)
  • Uninstall Ranorex Studio, restart your machine and install it via the *.exe file from the following link: https://www.ranorex.com/free-trial/
regards,
qertzu

MarkF
Posts: 10
Joined: Fri Jan 29, 2016 3:31 pm

Re: Problems adding reference to Ranorex project.

Post by MarkF » Wed May 03, 2017 5:25 pm

qertzu,

Thanks for you suggestions. I tried numerous things this morning, and it seems like oddly removing the 'System.Diagnostics.DiagnosticSource' reference from my class library (which again is 4.3.0 rather than 4.0.xx.0) rather than the System.Diagnostics.Tracing removes the warning and allows Ranorex to resolve the namespaces etc. from the class library.

I'm definitely using 4.5.2 from the compiling tab, I had to convert this as it seems to default to 4.0. In fact there seems to be another issue with this but think that's going to need another thread which I might start tomorrow. Might try your suggestion to reinstall Ranorex first though.

Cheers,