AMT Help Files

Loading the ComScript Module

Copying the Amt ComScript Module files

When the Amt ComScript Module will be used on a machine which does not have an installed AMT Environment, it is necessary to copy the Amt ComScript Module library files to this machine.

To do this copy the contents of the folder <Your AMT Environment>\AmtTools\ComScript, from a server with an installed AMT Environment, to a folder on the machine the Amt ComScript Module will be used.
 

Powershell

# First load the ComScript Module dll
Add-Type -Path '<Path to ComScript Module>\ComScript.dll'

# Then create a ComScript Module object
$ComScr = New-Object Asysco.Amt.Scripting.ComScript

 

C# (.NET)

Refering to the ComScript dll

Open (Create) the project to use the ComScript Module in, in Visual Studio. Then right click the 'Dependencies' node of the project and click 'Add Reference'. Browse to the folder <Your Environment>\AmtTools\ComScript and add a reference to the ComScript.dll.

 

Adding reference to System.Data.SqlClient 4.8.5

A reference to System.Data.SqlClient v4.8.5 needs to be added when the following exception occurs:
'System.Data.SqlClient is not supported on this platform'. The SqlClient reference is used by AMT internally. When the exception happens, .NET was not able to resolve the correct version. This is solved by adding the project reference.

This reference can be added via the NuGet package manager by right clicking on the 'Dependencies' node of the project, browsing to System.Data.SqlClient version 4.8.5 and installing it.

Alternatively it can be added directly to the project file by adding the following package reference:
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />

 

The ComScript Module can then be used in the code of the project.

It is advised to add a 'using Asysco.Amt.Scripting;' directive to every code file the ComScript Module will be used.