debug cBots or Custom Indicators in Visual Studio 2017 not work

Created at 14 Mar 2018, 07:00
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!
Bits's avatar

Bits

Joined 14.03.2018

debug cBots or Custom Indicators in Visual Studio 2017 not work
14 Mar 2018, 07:00


​cTrader beta 3.0 and vs 2017.

After  attach Visual Studio to cAlgo process, the indicator not running. if runnining in ctrader,donot go go debuger.


@Bits
Replies

Bits
14 Mar 2018, 07:03 ( Updated at: 21 Dec 2023, 09:20 )

RE:

yearn2012 said:

​cTrader beta 3.0 and vs 2017.

After  attach Visual Studio to cAlgo process, the indicator not running. if runnining in ctrader,donot go go debuger.

2.the image in  help document  is not show.

 

 


@Bits

PanagiotisCharalampous
14 Mar 2018, 09:50

Hi yearn2012,

The reason you cannot debug a custom indicator is because you probably installed cTrader 3.0 on a computer that already has cAlgo 2.01 installed. In this case, your existing cBots are not replaced, however they need a necessary addition in order to be debuggable in Visual Studio. In order to resolve this problem, please follow the next steps

  1. Go to Properties > AssemblyInfo.cs
  2. Add the following code at the bottom of the file
#if DEBUG
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations)]
#endif

This should fix your problem. Repeat this solution for every indicator/cBot you need to debug in Visual Studio. Newly generated cBots/Indicators should contain this attribute by default.

Best Regards,

Panagiotis


@PanagiotisCharalampous

Bits
09 Apr 2018, 05:26

RE:

Panagiotis Charalampous said:

Hi yearn2012,

The reason you cannot debug a custom indicator is because you probably installed cTrader 3.0 on a computer that already has cAlgo 2.01 installed. In this case, your existing cBots are not replaced, however they need a necessary addition in order to be debuggable in Visual Studio. In order to resolve this problem, please follow the next steps

  1. Go to Properties > AssemblyInfo.cs
  2. Add the following code at the bottom of the file
#if DEBUG
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations)]
#endif

This should fix your problem. Repeat this solution for every indicator/cBot you need to debug in Visual Studio. Newly generated cBots/Indicators should contain this attribute by default.

Best Regards,

Panagiotis

 

Thank you  Panagiotis ​, the issume is Solved!


@Bits