Referencing .NET Libraries/Packages
How Do I Reference Local .NET Libraries (DLL Files)?¶
cTrader Automate API allows for referencing .NET libraries from cBots and custom indicators. To do so, open the 'Reference Manager' window by clicking on the 'Manage References' button at the top of the code editor.
In the newly opened window, select the 'Browse' tab.
Click on 'Browse', select a locally stored
.dll file and press 'Open'. Afterward, click on 'Apply' to save your changes.
To use your newly imported library, reference the related namespace in your code.
1 2 3
This will enable you to use classes from your library directly in your code.
1 2 3 4 5
Can I Use Nuget Packages?¶
In brief, yes, you can. For a detailed example of how to use and install Nuget packages, please, check out our article on working with IDEs.
Remember that to install Nuget packages you can use the following tools.
Install-Packagecommand available in the Nuget package manager console.
- The Visual Studio Nuget package manager GUI.
- .NET CLI.