External assemblies

It is possible to use external assemblies in scripts and global modules. Both standard and compiled user assemblies can be used.

Adding external assemblies

An assembly can be added on the .Net References tab of the batch type properties, project properties or Document Definition properties. All classes of the added assemblies are available in scripts and global modules.

Assemblies added in batch type properties and Document Definition properties are available to a particular batch type or Document Definition respectively. Assemblies added in project properties are shared assemblies which are available to all batch types and Document Definitions of the given project. So if you need to use the same assembly for different batch types and Document Definitions, you can use a shared assembly. If a shared assembly must be updated, you need to update it in project properties only.

To add an assembly in project properties, do the following:

  1. On the .Net References of the project properties, click Add...
  2. In the Add Assembly dialog box that opens select the type: Standard assembly name or Attached file.
  3. Depending on the selected type either enter the standard assembly name or browse to an assembly file.

A shared assembly is added to newly created batch types automatically. To add a shared to Document Definitions and existing batch types, do the following:

  1. On the .Net References of batch type or Document Definition properties, click Add...
  2. In the Add Assembly dialog box that opens select Shared assembly.
  3. Select the assembly name from the Reference list.
    Note: You cannot add a shared assembly with a name which is similar to the name of an existing standard assembly.

Below is a sample code of the 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 by standard FlexiCapture means static method void ShowMessage(string text, bool IsError) from static class FCTools ABBYY.FlexiCapture.FCTools.ShowMessage(text, false);

For classes and methods of an added assembly to be accessible to the event handler scripts, it must be added on the .Net References tab of the batch type properties (for a particular batch type) or project properties (for the Default batch type).

For the following scripts, external assemblies are added on the .Net References tab of the Document Definition properties:

The script using classes and methods from the external assembly must 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

Debugging external assemblies

When debugging external assemblies, both the assembly file and a .pdb-file with symbolic information are required. Only assemblies with loaded .pbd files can be debugged. As pbd-files are rather large, it is better to disable loading symbolic information in the working project.

Registry keys that control the loading of symbolic information

You can use the following registry keys to specify whether .pdb-files should be loaded:

  • HKEY_CURRENT_USER\Software\ABBYY\FlexiCapture\12.0\Controller\ScriptSupport\ [LoadSymbolsFromOriginalPath] - specifies whether to load pdb-files from the original folders of the assembly files (set the key value to true to load .pdb-files);
  • HKEY_CURRENT_USER\Software\ABBYY\FlexiCapture\12.0\Controller\ScriptSupport\ [PDBSearchLocations] = - sets the search paths for .pbd-files (paths must be listed separated by semicolons; the search result is a .pdb-file with symbolic information whose name coincides with an assembly name).

These keys are not created in the registry by default. If required, the Administrator may add these keys into the registry of the user's operating system.

For the changes in the registry to take effect, you need to restart the program.

For debugging an assembly, connection to managed code must be used.

25.05.2023 7:55:02

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.