Referenced external dll but build fails with (CS0246) error

Class library usage, coding and language questions.
txrackack
Posts: 8
Joined: Fri Mar 11, 2016 5:21 pm

Referenced external dll but build fails with (CS0246) error

Post by txrackack » Fri Apr 22, 2016 4:48 pm

The type or namespace name 'RanorexOracleLibrary' could not be found (are you missing a using directive or an assembly reference?) (CS0246). Line of code where failure reports is at the using statement. I've added reference in the project.

I'm using trial version while waiting for PO to go through if that makes any difference. (limited feature in trial?)

The point of the dll is to handle Oracle operations for multiple projects in the solution such as reset of database which can happen faster this way than via recorded steps. I initially attempted to do this via code module but references to Oracle.ManagedDataAccess failed with the same error. So it seems that there may be issues with the external dlls. Other possibility could e versioning conflicts with .net framework versions but still looking into that one.

User avatar
RobinHood42
Posts: 240
Joined: Fri Jan 09, 2015 3:24 pm

Re: Referenced external dll but build fails with (CS0246) error

Post by RobinHood42 » Mon Apr 25, 2016 12:13 pm

Hi,

It seems the assembly reference are not compatible. Please check if the bit version and the .Net Framework of your project are the same as used in your DLL. You can find the settings in the project properties (compiling section) in Ranorex Studio.

Cheers,
Robin

txrackack
Posts: 8
Joined: Fri Mar 11, 2016 5:21 pm

Re: Referenced external dll but build fails with (CS0246) error

Post by txrackack » Tue Apr 26, 2016 8:10 pm

Wow, Thanks Robin. Seems that the Ranorex project is running on 2.0 and I'm developing with 4.5. Well I guess I'll have to "update" my dll and use the old fashioned way of working with Oracle. :cry:

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Referenced external dll but build fails with (CS0246) error

Post by krstcs » Wed Apr 27, 2016 2:27 pm

If you have .NET 4.5 installed, you can set the Ranorex project to use that instead of 2.0. Right-click the project and select 'Properties', then the 'Build' tab and change the target version to 4.5.

Just be aware that Ranorex 5.4.X and earlier is built on SharpDevelop 3.2, which does not support .NET 4.5, so, while you can build and run with 4.5 (Ranorex uses .NET's MSBuild.exe to build), you won't get accurate Intellisense and syntax highlighting.
Shortcuts usually aren't...