Hi all,
I have been facing an issue where I have created a nupkg for certain DLL files which I want to use in our project. Out of these DLLs one is built for 64-bit only targeted CPU. However, UiPath studio is built on 32-bit platform. So, when I run the code using this DLL, it throws error for compatibility issue and does not run.
How can I use this DLL file in the project and run the code? The same code if I write in the C#.net/VB.net runs smoothly.
Hello Rajdeepsinh,
as far as I know it is not possible to use libraries, which are compiled exclusively for x64, with UiPath. As you wrote correctly, UiPath is an x86 application.
Create an x64 executable which contains your code. If you have different methods, make it possible to call them via parameterization. With the Start Process activity you can call x64 executables too.
On this way you can realize an integration.
Best regards
Stefan
Hello Rajdeepsinh,
sure. At first a test library, in your case the Autodesk library. In my case only an example for demonstration.
//-Begin----------------------------------------------------------------
public class ExeWrapperLibrary {
public string MethodOne(string ArgumentOne) {
return "Hello World from " + ArgumentOne;
}
}
//-End------------------------------------------------------------------
Now the executable to call this library.
//-Begin----------------------------------------------------------------
using System;
public class ExeWrapper {
public static void Main(string[] args) {
string ret = string.Empty;
ExeWrapperLibrary lib = new ExeWrapperLibrary();
if(args.Length == 0) {
return;
}
ret = lib.MethodOne(args[0]);
Console.WriteLine(ret);
Console.ReadKey();
}
}
//-End------------------------------------------------------------------
Both are compiled for the x64 platform with this batch.
Hi @StefanSchnell,
Thanks very much for the reply and the code suggestion. But here I need more help. My requirement is little bit complex. Basic idea was to have custom activities, so the programmer can choose any one or more in the program. Now That possibility is ruled out because of 64-bit Architecture.
In the executable code there needs more than one function to do various actions. Now depending upon programmer’s need multiple functions needs to be called.
Are there only arguments which can be used to pass instructions to the Main() method, or we can call functions from outside of the code also like from the Uipath program?
Hello Rajdeepsinh,
here an example to call methods. At first the library with two different methods:
//-Begin----------------------------------------------------------------
using System;
public class ExeWrapperLibrary {
public string MethodOne(string ArgumentOne) {
return "Hello World from " + ArgumentOne;
}
public int MethodTwo(string ArgumentOne, int ArgumentTwo) {
return Convert.ToInt32(ArgumentOne) + ArgumentTwo;
}
}
//-End------------------------------------------------------------------
And here now the executable to use this library:
//-Begin----------------------------------------------------------------
using System;
public class ExeWrapper {
public static void Main(string[] args) {
string strRet = string.Empty;
int intRet = 0;
ExeWrapperLibrary lib = new ExeWrapperLibrary();
if(args.Length == 0) {
return;
}
switch(args[0]) {
case "MethodOne" :
strRet = lib.MethodOne(args[1]);
Console.WriteLine(strRet);
break;
case "MethodTwo" :
intRet = lib.MethodTwo(args[1], Convert.ToInt32(args[2]));
Console.WriteLine(intRet.ToString());
break;
default:
Console.WriteLine("No known method invoked");
break;
}
Console.ReadKey();
}
}
//-End------------------------------------------------------------------
In this example is the first parameter of the executable the name of the method you want to invoke. On this way you can code an executable wrapper for the x64 library and use it with x86 applications.
Maybe you should try the program CorFlags. It might be possible to use the library with x86 applications.