Page 1 of 1

Referenced external dll but build fails with (CS0246) error

Posted: Fri Apr 22, 2016 4:48 pm
by txrackack
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.

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

Posted: Mon Apr 25, 2016 12:13 pm
by RobinHood42
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

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

Posted: Tue Apr 26, 2016 8:10 pm
by txrackack
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:

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

Posted: Wed Apr 27, 2016 2:27 pm
by krstcs
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.