Requirements for cBots¶
There are two main requirements you have to meet to ensure that your cBot instances can smoothly run in Cloud.
Compile-Time References¶
There are multiple ways to work with dependencies in .NET. For example, you may supply dependencies as individual .dll
files without including them directly in your project executable.
However, only compile-time references are fully compatible with running cBots in Cloud. Cloud acts as a dedicated environment that runs the cBot executable (the .algo
file) without managing any external .dll
files.
Compile-time dependencies are ensured in all cases where you reference a library in the using
statements at the top of your code. However, if you reference a stand-alone .dll
file within the body of your code (e.g., via the Assembly.Load()
method), this reference will not be compile-time, and your cBot will not perform any related operations in Cloud.
Using Cross-Platform Dependencies¶
Cloud executes all cBots in a Linux-based environment. This means that if you want to use external dependencies, these dependencies have to be cross-platform.
As an illustration, here are some dependencies that will not work in Cloud as they are specific to Windows.
- WPF
- WinForms
- WinAPI
When adding a new dependency into your project, read its documentation to learn whether it is supported in Linux-based environments.
API Features¶
There are several Algo API features that work differently in Cloud when compared to local execution.
Feature/Method | How it Works in Cloud |
---|---|
MessageBox | Always returns MessageBoxResult.None |
Window | Is always ignored |
Notifications.PlaySound() | Is always ignored |
Account.UserNickName | Always calls the OnException() handler |
Chart.TakeChartshot() | Always returns null |
WebSocketClient | Only works if you connect to a service via port 25345 |
HTTP | No HTTP requests are sent |
LocalStorage and file operations | Only works if relative paths are specified or new directories are created from scratch |
Local Storage and File Operations
Whenever a Cloud instance is stopped or deleted, all resources allocated to it within Cloud are automatically freed. If your cBot creates files or directories and then accesses data from them, these files will be deleted on every instance restart or deletion.