Using Ranorex 1.5 And 2.X Together in the Same Project
Download Sample Project (11KB)
Requirements:
- Ranorex 1.5 and 2.x installed on same machine.
- .NET 3.5 if you are using Ranorex Studio.
Steps:
- Open an existing project that uses (References) the RanorexNet.DLL (
.csproj) - Select the RanorexNet reference and open the properties. Give it a new alias for example RanorexNet .

- In all code files where the Ranorex namespace is used add
extern alias <new alias name>;
for example
extern alias RanorexNet;
to the top of the file before all using statements. Then change
using Ranorex;
to
using RanorexNet.Ranorex;
- To use the Ranorex namespace from both the RanorexNet.dll and the Ranorex.Core.dll together in the same code file you will also need to alias the namespace for example
using RX15 = RanorexNet::Ranorex;
- If you alias the name space in a code file you will also need to update the code to use the new qualified name. For example, change from
Logger.LogFileTitle = "Ranorex Log File";
to
RX15.Logger.LogFileTitle = "Ranorex Log File";
- Add a reference to the Ranorex.Core.dll from the GAC. Important, it is not recommended that you alias the Ranorex.Core.dll because the generated code doesn’t add the “extern alias” statement. However, feel free to alias the namespace whenever you need to.

Subscribe