Articles → AUTOMATION ANYWHERE → Call C# DLL In Automation Anywhere
Call C# DLL In Automation Anywhere
C# DLL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestLibrary {
public class MyClass {
public int Sum(int a, int b) {
return a + b;
}
}
}
Calling C# Code From Automation Anywhere
- Open automation anywhere client and login using credentials.
- Click on ‘New MetaBot’. A pop window will appear as shown in figure below
Click to Enlarge
- Enter MetaBot name, select ‘All Applications’ as metabot type and click on ‘Create’ button.
- From home screen, click on ‘Add Dll’ button
Click to Enlarge
- Once you click on the button, a window will appear to select the dll.
- Once you select the dll, it will be added in the metabot.
Click to Enlarge
- Next step is to add logic. For adding the logic, click on ‘Add Logic’ button.
Click to Enlarge
- In add logic window, you can see all the classes and methods of the DLL.
Click to Enlarge
- You can double click on the function to enter the input variables value
Click to Enlarge
- Click on ‘Add’.
- A logic is added in left side of the designer
Click to Enlarge
- Save the logic by pressing ‘CTRL+s’
Click to Enlarge
Call Metabot Using Task Bot
- Drag and drop the metabot from command window
Click to Enlarge
- Following window will appear
Click to Enlarge
- As we have provided input variables and put the output in clipboard, so no action is required here. Click on ‘Save’.
- Finally display the output in message box
Click to Enlarge
Output
Click to Enlarge