cTrader version 4.4 VS2022 Debug issues

Created at 06 Oct 2022, 14:13
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!
DA

DASOLMA

Joined 06.10.2022

cTrader version 4.4 VS2022 Debug issues
06 Oct 2022, 14:13


Hello,

After upgrading to cTrader version 4.4.13.9632 none of my CBots are working in Debug mode with Visual Studio 2022. I just get this message "Symbol loading for optimized module System.Private.CoreLib.dll was skipped because Just My Code is enabled.

Previously everything was working with "Just My Code" enabled...

If I disable Just My Code from "Tools->Options->Debugging->General-> Enable Just My Code" I get this message:

Of course I have "AccessRights = AccessRights.FullAccess"  and "System.Diagnostics.Debugger.Launch();" in the cBot code and Target Framework is .Net 6.0.

Everything was working fine up the the upgrade to 4.4 from 4.3 version.

Please help, give me ideas of how to make it work with 4.4, probably if I downgrade to 4.3 will work but would be silly to go back to previous version.

Thank you!

Gabriel


@DASOLMA
Replies

DASOLMA
07 Oct 2022, 02:11 ( Updated at: 21 Dec 2023, 09:22 )

RE: Figured out!

Figured out the damn thing, you'll need to follow a STRICT ORDER for debugging your cBots code:

  1. Go to cBot in cTrader->Automate
  2. Make sure AccessRights.FullAccess and Debugger.Launch() in cBot
  3. Click Right->Edit in Visual Studio
  4. Once in Visual Studio make sure you are in Debug solution configuration NOT in Release or something else.
  5. Set a breakpoint(s) in your C# code (make sure the code logic will hit that breakpoint)
  6. !!!Build Solution in VS2022!!!
  7. Go back to your cBot and open an instance (e.g. AUDUSD m1)
  8. Start the cBot in cTrader
  9. Chose Just-In-Time Debugger you opened previously (NOT a new instance of Visual Studio)
  10. The Debugger will stop on System.Diagnostics.Debugger.Launch();  Click Continue button
  11. Now you should hit the breakpoint and continue with your debugging.

Any point you miss or you don't do it in the sequence as above.....could lead you to "Symbol loading skipped" and the debugger not working. 

My mistake was not doing point 6 AFTER setting the breakpoint(s). I mean...I was building the solution before setting up the breakpoints and not after that. Who knew!?

Hope it helps others!

Cheers,

Gabriel

DASOLMA said:

Hello,

After upgrading to cTrader version 4.4.13.9632 none of my CBots are working in Debug mode with Visual Studio 2022. I just get this message "Symbol loading for optimized module System.Private.CoreLib.dll was skipped because Just My Code is enabled.

Previously everything was working with "Just My Code" enabled...

If I disable Just My Code from "Tools->Options->Debugging->General-> Enable Just My Code" I get this message:

Of course I have "AccessRights = AccessRights.FullAccess"  and "System.Diagnostics.Debugger.Launch();" in the cBot code and Target Framework is .Net 6.0.

Everything was working fine up the the upgrade to 4.4 from 4.3 version.

Please help, give me ideas of how to make it work with 4.4, probably if I downgrade to 4.3 will work but would be silly to go back to previous version.

Thank you!

Gabriel

 


@DASOLMA

Waxy
07 Oct 2022, 21:08

RE: RE: Figured out!

Even if these messages show up you should be able to keep debugging after closing them, that's what I did.
The problem is that these errors show up and it's annoying, haven't been able to fix it.

 


@Waxy

DASOLMA
07 Oct 2022, 22:32

RE: RE: RE: Figured out!

In my case closing these messages down leads to "Source not available" and a complete breakdown of the compiler, I can't see any code. 

Have you "Build Solution" in Visual Studio after setting the breakpoints in the code, and only after that started the cBot in debug mode?

Waxy said:

Even if these messages show up you should be able to keep debugging after closing them, that's what I did.
The problem is that these errors show up and it's annoying, haven't been able to fix it.

 

 


@DASOLMA

Waxy
08 Oct 2022, 09:36 ( Updated at: 08 Oct 2022, 09:37 )

RE: RE: RE: RE: Figured out!

Please see video attached, so I have these problems but I'm still able to debug afterwards.


@Waxy

DASOLMA
08 Oct 2022, 11:28 ( Updated at: 21 Dec 2023, 09:22 )

RE: RE: RE: RE: RE: Figured out!

Wow, for you the situation is bearable, you just Load the symbols manually and then continue with the debugging. 

In my case, the debugger stops entirely, the Continue button is greyed out and I have an yellow exclamation point at the breakpoint in the code, plus this message "The breakpoint will not currently be hit. No symbols have been loaded for this document" :

 

Waxy said:

Please see video attached, so I have these problems but I'm still able to debug afterwards.

 


@DASOLMA

Waxy
08 Oct 2022, 11:37

RE: RE: RE: RE: RE: RE: Figured out!

Do check if my settings may help you somehow please. But I'd also like Spotware to help about the annoying System.Private.CoreLib.dll issue

 


@Waxy

DASOLMA
09 Oct 2022, 23:48 ( Updated at: 21 Dec 2023, 09:22 )

Debugging options

These are the differences with mines, the other ones are the same:

As you can see I have "Just My Code" enabled and also "NuGet.org Symbol Server" enabled, your System.Private.CoreLib.dll issue might come from NuGet.org Symbol Server not being enabled.


@DASOLMA

Spotware
10 Oct 2022, 08:16

Dear traders,

We are not able to reproduce any of the aforementioned issues. If you can record a video with the exact steps you are following, we are happy to have a look and advise.

Best Regards,

cTrader Team


@Spotware

acrigney
26 Nov 2022, 00:08

RE:

I am still completely unable to get debugging to work and my broker Fondex said that it was an issue with the latest version and will be fixed in this new version.

And I think its a ridiculous idea that you would have to rebuild a bot just to debug it. 

Spotware said:

Dear traders,

We are not able to reproduce any of the aforementioned issues. If you can record a video with the exact steps you are following, we are happy to have a look and advise.

Best Regards,

cTrader Team

 


@acrigney

Shares4us
14 Sep 2023, 20:18

RE: RE: Figured out!

revert to cTrader.Automate 1.0.7 (Nuget)
That worked for me.


@Shares4us

dreampunchboy
15 Jan 2024, 09:53

Building the solution/project fixed my issue

Building the solution/project fixed my issue


@dreampunchboy