Debug using Visual Studio 2022

Created at 07 Apr 2022, 11:06
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!
SH

shaahin69

Joined 28.01.2022

Debug using Visual Studio 2022
07 Apr 2022, 11:06


Hi 

I wonder if I can debug the cBot using Visual Studio 2022? I've tried the explained approach in the docs but it does not work. 

Firstly the cBot extension for vs 2022 is not found. And without that the break point never hits even if I attach to cTrader process and attempt to debug. 

Any ideas/workarounds? 

Thank you in advance! 


@shaahin69
Replies

amusleh
07 Apr 2022, 14:02

Hi,

Visual studio 2022 and .NET 6 support is added to cTrader 4.2 which is in beta testing now, you can try it by downloading Spotware cTrader Beta.


@amusleh

ClickAlgo
07 Apr 2022, 14:12

This may also help, please correct if incorrect amusleh.

 

 


@ClickAlgo

shaahin69
07 Apr 2022, 14:17

RE:

amusleh said:

Hi,

Visual studio 2022 and .NET 6 support is added to cTrader 4.2 which is in beta testing now, you can try it by downloading Spotware cTrader Beta.

Thank you for your reply. 

However, I already got cTrader 4.2 along with a new cBot project using .NET 6. 

Although I can build the cBot ok without any issue, but debugging doesn't work. 

Do I require https://marketplace.visualstudio.com/items?itemName=Spotwareextensions.cBotsandCustomIndicators for Visual Studio 2022 for debugging? 

 


@shaahin69

ClickAlgo
08 Apr 2022, 10:51 ( Updated at: 08 Apr 2022, 10:52 )

This step-by-step guide should help.

https://ctrader.info/d/442-how-to-debug-a-cbot-using-visual-studio-2022


@ClickAlgo

amusleh
08 Apr 2022, 10:54 ( Updated at: 08 Apr 2022, 11:12 )

RE: RE:

shaahin69 said:

amusleh said:

Hi,

Visual studio 2022 and .NET 6 support is added to cTrader 4.2 which is in beta testing now, you can try it by downloading Spotware cTrader Beta.

Thank you for your reply. 

However, I already got cTrader 4.2 along with a new cBot project using .NET 6. 

Although I can build the cBot ok without any issue, but debugging doesn't work. 

Do I require https://marketplace.visualstudio.com/items?itemName=Spotwareextensions.cBotsandCustomIndicators for Visual Studio 2022 for debugging? 

 

Hi,

If your project is a legacy project created by older versions of cTrader and targeting .NET framework then you can't use Visual Studio 2022 to open it, you can only open new cTrader 4.2 projects with Visual Studio 2022.

Regarding debugging, the way we were debugging old .NET framework cBots/Indicators has changed, and there is no Visual studio extension for new cTrader 4.2 projects, you can build a cBot/Indicator algo file with any .NET IDE just by referencing the cTrader automate Nuget package.

We are creating a new documentation for cTrader automate that covers all these topics, it will be released alongside cTrader 4.2.


@amusleh