Skip to main content
You can use external assemblies in scripts and global modules. Both standard and compiled user assemblies can be used.

Adding external assemblies

You can add external assemblies on the Scripts tab of the Batch Type Properties dialog box or in Tools > Options…. All the classes and methods of the assemblies that you add are available to scripts and global modules. Assemblies that you add to the properties of a batch type are available only to that batch type. To add an assembly, follow these steps:
  1. Open the Project Properties dialog box, click the Scripts tab, and then click the References .Net… button.
  2. In the dialog box that opens, click Add…
  3. In the Add Assembly dialog box, select Attached file or Standard assembly name in the type field.
  4. Depending on the selected type, either specify the path to the file or the standard name.
Below you can find sample code of a user assembly that contains a namespace, a class, and a method of this class:
namespace TestNameSpace
{
public class Test
    {
    public void Show(string text)
        {
        // will show text message – static method Show(string text) from class System.Windows.Forms.MessageBox;
System.Windows.Forms.MessageBox.Show(text);
        }
    }
}
A script that uses class and methods of an external assembly should contain the following code:
TestNameSpace.Test test = new TestNameSpace.Test(); // creates an object of Test class
test.Show("Hello world"); // calls void Show() method from Test class