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




  1. Open automation anywhere client and login using credentials.
  2. Click on ‘New MetaBot’. A pop window will appear as shown in figure below
  3. Picture showing the New Metabot window for adding the metabot name in automation anywhere
    Click to Enlarge

  4. Enter MetaBot name, select ‘All Applications’ as metabot type and click on ‘Create’ button.
  5. From home screen, click on ‘Add Dll’ button
  6. Picture showing the Add dll button for adding the dll in the metabot
    Click to Enlarge

  7. Once you click on the button, a window will appear to select the dll.
  8. Once you select the dll, it will be added in the metabot.
  9. Picture showing the dll added in the meta bot in the Assets tab
    Click to Enlarge

  10. Next step is to add logic. For adding the logic, click on ‘Add Logic’ button.
  11. Picture showing the Add Logic button in meta bot
    Click to Enlarge

  12. In add logic window, you can see all the classes and methods of the DLL.
  13. Picture showing the add logic window with the dll, class and method information
    Click to Enlarge

  14. You can double click on the function to enter the input variables value
  15. Picture showing a window to enter the input value in the sum function
    Click to Enlarge

  16. Click on ‘Add’.
  17. A logic is added in left side of the designer
  18. Picture showing the code in the designer window
    Click to Enlarge

  19. Save the logic by pressing ‘CTRL+s’
  20. Picture showing the window to save the logic in metabot
    Click to Enlarge

Call Metabot Using Task Bot




  1. Drag and drop the metabot from command window
  2. Picture showing the metabot command in automation anywhere
    Click to Enlarge

  3. Following window will appear
  4. Picture showing the window for selecting the logic
    Click to Enlarge

  5. As we have provided input variables and put the output in clipboard, so no action is required here. Click on ‘Save’.
  6. Finally display the output in message box
  7. Picture showing the message box command to display the output
    Click to Enlarge

Output


Picture showing the message box to display the output
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, June 21, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250