You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Overview

Script References refer to external DLLs (Dynamic Link Libraries) incorporated for compiling scripts or display codes in solution. These references allow users to extend the capabilities of their scripts by leveraging additional functionalities provided by external libraries.

On this page:


Configuring References

To add a Script Reference, follow the steps below:

  1. Access Scripts References.
  2. Click on the plus icon.
  3. Browse and select the DLL file that you wish to reference in your solution.
  4. Input a name, description, and a choose the domain target for the reference.
  5. Click OK.

Once added, a new row will appear in the References table corresponding to the DLL file you selected. 

image2023-9-8_15-43-22.png


Script References Configuration Table

The following is a table describing each available property field for script classes:

PropertyDescription

Target Domain

Specifies the domain where the DLL will be used (client or server).

NetAssemblyName

The name of the reference.

DefaultNamespace

The default namespace used by the DLL.

Resolved 

Indicates whether the reference has been successfully resolved. A checkmark symbol (?) signifies that the DLL import compiled without errors, whereas an 'X' indicates that there were compilation errors. If you encounter an 'X', hover over the line of your Script Reference to view the error code and a description of the problem.

Portable

Shows if the DLL is portable across different platforms.

AssemblyPathLocal

The local path of the assembly file.

AssemblyPathRuntime

The runtime path of the assembly file used during execution.


Loading and placing the External DLL

It's necessary to understand the best location to put the external DLLs, and when they loaded by the platform. 

We have two situations.


1. When we are in Runtime: The DLL is loaded when the Script Module is started. So if need to update the DLL file, you need to stop the Script module and close the Designer (Solution engineering), so, you can replace the DLL file in the folder, and after you can run the Script Module again and the DLL will be updated.

2. Just inside the Designer: The DLL file is loaded when the Edit>Scripts page is open for the first time.

If you open the project, open the Scripts, and add for the first time a new DLL in the reference, you can back to Scripts and you will be able to use the DLL.

But, if you add a DLL in the reference, open the Scripts, and only after, you replace or update the DLL file, and open Scripts again, the script will not be able to find the new modifications of the DLL. You need close the project and open it again, and when you join in Edit>Scripts the DLL will be updated.


C# using or VB.NET Import statements

When using external DLLs it is common to have to add the namespaces of the DLL on your code. 

In C#, that is the using keyword, which is equivalent to the VB.NET Import.

Due some optimizations in our Code Editor, you can't add those namespaces directly in the code, you need to the Add Namespaces button on the top toolbar.

Use this Toolbar command to open the "Namespace Declarations" where you can your namespaces references, whatever you using C# or VB.NET language. 

Keeping the using or Import statement in the code will generate a compilation error.


In this section:

The root page @parent could not be found in space v10.

  • No labels