cTrader and JetBrains Rider

Created at 29 Nov 2022, 21:10
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CT

ctid2032775

Joined 03.05.2020

cTrader and JetBrains Rider
29 Nov 2022, 21:10


Dear all,

I am using JetBrains Rider for all C# projects and also with cTrader it's working fine - I can install the NuGet package, edit all files, compile the library and debug the cBot.

The only small flaw is that I have to open the cBot solution directly in Rider...

Is there a way to open the cBot source from cTrader similar to what can be done when Microsoft Visual Studio is installed?

Many thanks in advance and best regards,
Christian


@ctid2032775
Replies

josef.van.niekerk
22 Aug 2023, 11:35

Hi Christian, I'm a bit late to the party. However, I see the new cTrader 4.8 update allows you to open your project in Rider and VS Code as well.

Quick question though, are you actually able to debug your code with Rider as well?


@josef.van.niekerk

ThomasSparrow
22 Aug 2023, 12:21 ( Updated at: 21 Dec 2023, 09:23 )

RE: cTrader and JetBrains Rider

ctid2032775 said: 

Dear all,

I am using JetBrains Rider for all C# projects and also with cTrader it's working fine - I can install the NuGet package, edit all files, compile the library and debug the cBot.

The only small flaw is that I have to open the cBot solution directly in Rider...

Is there a way to open the cBot source from cTrader similar to what can be done when Microsoft Visual Studio is installed?

Many thanks in advance and best regards,
Christian

Yes on top of you cbot designer you have option menu, if you have instaled one of this software you can open cbot directly. if is the case ?

 


@ThomasSparrow

ctid2032775
22 Aug 2023, 12:23

RE: cTrader and JetBrains Rider

josef.van.niekerk said: 

Hi Christian, I'm a bit late to the party. However, I see the new cTrader 4.8 update allows you to open your project in Rider and VS Code as well.

Quick question though, are you actually able to debug your code with Rider as well?

Hi Josef,

thanks and no problem, I completely forgot about this post and already found out that cTrader 4.8 supports Rider…

And yes, I am actually able to debug my code with Rider but sometimes I get strange errors no matter if I select an already running or a new Rider instance.

Best regards,
Christian


@ctid2032775

josef.van.niekerk
28 Aug 2023, 20:41

Thanks Christian, I'm using the “Attach to Process” from Rider, then I just select the “algohost” process. It's a bit fiddly, would have hoped the JIT debug dialog would allow selecting Rider as an option, like it does with Visual Studio.


@josef.van.niekerk

ctid2032775
29 Aug 2023, 05:16

RE: cTrader and JetBrains Rider

josef.van.niekerk said: 

Thanks Christian, I'm using the “Attach to Process” from Rider, then I just select the “algohost” process. It's a bit fiddly, would have hoped the JIT debug dialog would allow selecting Rider as an option, like it does with Visual Studio.

Hi Josef,

you can add the following code snippet at the beginning of the method OnStart() …

var result = System.Diagnostics.Debugger.Launch();
if (result is false)
{
    Print("Debugger launch failed");
}

… and configure Rider as the default JIT debugger (File | Settings | Build, Execution, Deployment | Debugger).

When you then start the cBot the JIT debug dialog is shown …

Hope this helps!

BR, Christian


@ctid2032775

josef.van.niekerk
29 Aug 2023, 07:02 ( Updated at: 29 Aug 2023, 07:03 )

Thanks Christian. The above is most helpful. I am now getting a popup dialog from Rider instead, making debugging yet another step easier.


@josef.van.niekerk

josef.van.niekerk
29 Aug 2023, 07:05

RE: RE: cTrader and JetBrains Rider

ctid2032775 said: 

josef.van.niekerk said: 

Thanks Christian, I'm using the “Attach to Process” from Rider, then I just select the “algohost” process. It's a bit fiddly, would have hoped the JIT debug dialog would allow selecting Rider as an option, like it does with Visual Studio.

Hi Josef,

you can add the following code snippet at the beginning of the method OnStart() …

var result = System.Diagnostics.Debugger.Launch();if (result is false){    Print("Debugger launch failed");}

… and configure Rider as the default JIT debugger (File | Settings | Build, Execution, Deployment | Debugger).

When you then start the cBot the JIT debug dialog is shown …

Hope this helps!

BR, Christian

Thanks Christian, I'm using the “Attach to Process” from Rider, then I just select the “algohost” process. It's a bit fiddly, would have hoped the JIT debug dialog would allow selecting Rider as an option, like it does with Visual Studio.


@josef.van.niekerk