Migration from .NET Framework
When cTrader migrated from .NET framework?¶
cTrader desktop migrated from .NET framework to .NET 6 in version 4.2, in version 4.2 cTrader Automate changed significantly from older cTrader versions.
What changed in cTrader Automate?¶
cTrader Automate was using .NET Framework 4.0 and C# version 4 prior to migration, and all cBots/Indicators were running inside main cTrader desktop process.
After migration to .NET 6, cTrader Automate now uses separate child process for indicators/cBots and it uses a Nuget package for building indicators/cBots ".algo" files.
New version of cTrader is still backward compatible and you can continue using your indicators/cBots that were built by using older versions of cTrader based on .NET framework.
We recommend you to use .NET 6 or later for all your new projects.
How should I migrate from .NET framework to .NET?¶
To migrate from .NET framework to .NET (6++) you just have to rebuild you indicator/cBot inside a cTrader desktop 4.2 or later.
When you rebuild your indicator/cBot with cTrader 4.2++ it changes the .NET project structure to new SDK style
After rebuilding you can change your indicator/cBot to target .NET 6 via cTrader Automate code editor:
Test your indicator/cBot after rebuilding.
If your indicator/cBot uses File, Registry, or Internet access rights then change it to FullAccess.
In version 4.2 cBots/Indicators that are using multiple threads (ex: for UI) can't call the API members from them, you have to use the cBot/Indicator BeginInvokeOnMainThread method to call an API method/member otherwise you will get an error and your cBot/Indicator process will be terminated.
As cTrader Automate API is not thread safe, you have to use BeginInvokeOnMainThread method whenever you call/access an API member.