> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# External assemblies

> Add external .NET assemblies to Scanning Station scripts and global modules, call classes from script code, and debug assemblies with .pdb symbol files.

You can use external assemblies in scripts and global modules. Both standard and compiled user assemblies work.

## Add an external assembly

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 you add are available to scripts and global modules.

Assemblies that you add to the properties of a batch type or a Document Definition are available only to that batch type or Document Definition.

<Steps>
  <Step title="Open the References dialog box">
    Open the **Project Properties** dialog box, click the **Scripts** tab, and click **References .Net...**.
  </Step>

  <Step title="Add the assembly">
    In the dialog box that opens, click **Add...**.
  </Step>

  <Step title="Choose the assembly type">
    In the **Add Assembly** dialog box, select **Attached file** or **Standard assembly name** in the type field.
  </Step>

  <Step title="Specify the assembly">
    Depending on the selected type, specify either the path to the file or the standard name.
  </Step>
</Steps>

This sample user assembly contains a namespace, a class, and a method of that class:

```csharp theme={null}
namespace TestNameSpace
{
public class Test
    {
    public void Show(string text)
       {
      // shows a text message with the static method Show(string text) from class System.Windows.Forms.MessageBox
System.Windows.Forms.MessageBox.Show(text);
       }
    }
}
```

A script that uses a class and methods from an external assembly contains the following code:

```csharp theme={null}
TestNameSpace.Test test = new TestNameSpace.Test(); // creates an object of the Test class
test.Show("Hello world"); // calls the void Show() method from the Test class
```

## Debug external assemblies

To debug external assemblies, you need both the assembly file and the `.pdb` file with symbolic information. You can debug only assemblies with loaded `.pdb` files. Because `.pdb` files are large, disable loading symbolic information in the working project.

### Registry keys that control loading symbolic information

Use the following registry keys to specify whether to load `.pdb` files:

* `HKEY_CURRENT_USER\Software\ABBYY\ScanStationFC\4.0\Shell\Script [LoadSymbolsFromOriginalPath]` – Specifies whether to load `.pdb` files from the same folder as the assembly. To load `.pdb` files, set the value to `True`.
* `HKEY_CURRENT_USER\Software\ABBYY\ScanStationFC\4.0\Shell\Script [PDBSearchLocations] = <path to the folder with PDB files>` – Specifies the search paths for `.pdb` files. Separate paths with semicolons. The search returns a `.pdb` file with symbolic information whose name matches the assembly name.

These keys do not exist in the registry by default. If required, the Administrator can add them to the registry of the user's operating system.

To apply the registry changes, restart the Scanning Station.

To debug an assembly, connect to the managed code.
