Debugging in Visual Studio 2015

Created at 29 Oct 2015, 11:05
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!
MA

mail

Joined 29.10.2015

Debugging in Visual Studio 2015
29 Oct 2015, 11:05


Hi. I'm aware that the plugin does not currently support Visual Studio 2015. However, I was wondering if it is possible to setup a project manually to debug a cBot in VS2015?

I've tried :

  1. Creating a Class Library solution
  2. Adding a reference to the API dll
  3. Pasting in the cBot code
  4. Attaching it to the running cAlgo process

However it does not hit any of the breakpoints (it says "The breakpoint will not currently be hit. No symbols have been loaded for this document").

Should this work? If so, can you offer any advise?

Thanks 


@mail
Replies

Spotware
29 Oct 2015, 11:25

Dear Trader,

As per the instructions provided to users in the How to debug cBots or Custom Indicators in Visual Studio section of our support site, users need to build their cBot in "Debug" mode. Build in "Debug" mode won't be successful in Visual Studio 2015 because it isn't supported yet.


@Spotware

Vitali Gajdabrus
26 Jan 2016, 18:13

RE:

Spotware said:

Dear Trader,

As per the instructions provided to users in the How to debug cBots or Custom Indicators in Visual Studio section of our support site, users need to build their cBot in "Debug" mode. Build in "Debug" mode won't be successful in Visual Studio 2015 because it isn't supported yet.

When it is enabled Visual Studio 2015?


@Vitali Gajdabrus

Spotware
26 Jan 2016, 19:02

Dear Trader,

It will be available in the near future. However, we cannot provide you with an ETA.


@Spotware

acrigney
14 Jul 2017, 05:56

RE:

Spotware said:

Dear Trader,

It will be available in the near future. However, we cannot provide you with an ETA.

 

Love your work guys!!

But any update on when there will be support for VS2017 and when will debugging with VS2015/2017 will be available?

Best Regards,

                      Alistair


@acrigney

Spotware
14 Jul 2017, 11:37

Dear acrigney,

Many thanks for your nice words. We plan to start working on officially supporting Visual Studio 2015 and 2017 soon. Until official support is released, you can use this workaround provided by the community /forum/calgo-support/8514. We have tested it as well and it works fine.

Best Regards,

cTrader Team


@Spotware

acrigney
02 Aug 2017, 06:48

RE:

Spotware said:

Dear acrigney,

Many thanks for your nice words. We plan to start working on officially supporting Visual Studio 2015 and 2017 soon. Until official support is released, you can use this workaround provided by the community /forum/calgo-support/8514. We have tested it as well and it works fine.

Best Regards,

cTrader Team

Yes it works for VS2015 fine but not with VS2017 when I last tried it.


@acrigney

Spotware
02 Aug 2017, 09:07

Dear acrigney,

You should modify the vsixmanifest by adding the node for the VS2107 edition. The edition version is 15.1. See the following example

<?xml version="1.0" encoding="utf-8"?>

<Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="2c72cc50-6c69-4b16-b1f4-ab470673f284">
    <Name>cBots and Custom Indicators</Name>
    <Author>Spotware</Author>
    <Version>1.4</Version>
    <License>EULA.txt</License>
    <Description xml:space="preserve">Building cBots and Custom Indicators in Visual Studio</Description>
    <Locale>1033</Locale>
    <InstalledByMsi>false</InstalledByMsi>
    <SupportedProducts>
      <VisualStudio Version="10.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0">
        <Edition>Pro</Edition>
      </VisualStudio>
<VisualStudio Version="13.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="14.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.1">
  <Edition>Community</Edition>
</VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References>
    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
      <Name>Visual Studio MPF</Name>
    </Reference>
  </References>
  <Content>
    <VsPackage>VSExtension.pkgdef</VsPackage>
  </Content>
</Vsix>

Best Regards,

cTrader Team


@Spotware

acrigney
10 Aug 2017, 08:59

RE:

Sorry I tried this new version and it did not work. When I went to install i.e double click the vsx file it found the VS2017 community version but then it said if I installed the extension was not compatible with VS2017 and would make VS2017 unstable

 

Spotware said:

Dear acrigney,

You should modify the vsixmanifest by adding the node for the VS2107 edition. The edition version is 15.1. See the following example

<?xml version="1.0" encoding="utf-8"?>

<Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="2c72cc50-6c69-4b16-b1f4-ab470673f284">
    <Name>cBots and Custom Indicators</Name>
    <Author>Spotware</Author>
    <Version>1.4</Version>
    <License>EULA.txt</License>
    <Description xml:space="preserve">Building cBots and Custom Indicators in Visual Studio</Description>
    <Locale>1033</Locale>
    <InstalledByMsi>false</InstalledByMsi>
    <SupportedProducts>
      <VisualStudio Version="10.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0">
        <Edition>Pro</Edition>
      </VisualStudio>
<VisualStudio Version="13.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="14.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.1">
  <Edition>Community</Edition>
</VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References>
    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
      <Name>Visual Studio MPF</Name>
    </Reference>
  </References>
  <Content>
    <VsPackage>VSExtension.pkgdef</VsPackage>
  </Content>
</Vsix>

Best Regards,

cTrader Team

 


@acrigney

Spotware
10 Aug 2017, 10:17

Dear acrigney,

There was an update recently in VS2017 so maybe you are using v 15.2. Can you please update your vsixmanifest as follows?

<?xml version="1.0" encoding="utf-8"?>
 
<Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="2c72cc50-6c69-4b16-b1f4-ab470673f284">
    <Name>cBots and Custom Indicators</Name>
    <Author>Spotware</Author>
    <Version>1.4</Version>
    <License>EULA.txt</License>
    <Description xml:space="preserve">Building cBots and Custom Indicators in Visual Studio</Description>
    <Locale>1033</Locale>
    <InstalledByMsi>false</InstalledByMsi>
    <SupportedProducts>
      <VisualStudio Version="10.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0">
        <Edition>Pro</Edition>
      </VisualStudio>
<VisualStudio Version="13.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="14.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.1">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.2">
  <Edition>Community</Edition>
</VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References>
    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
      <Name>Visual Studio MPF</Name>
    </Reference>
  </References>
  <Content>
    <VsPackage>VSExtension.pkgdef</VsPackage>
  </Content>
</Vsix>

Let us know if the above solves the problem.

Best Regards,

cTrader Team


@Spotware

warwick
18 Oct 2017, 12:36

RE:

Spotware said:

Dear acrigney,

There was an update recently in VS2017 so maybe you are using v 15.2. Can you please update your vsixmanifest as follows?

<?xml version="1.0" encoding="utf-8"?>
 
<Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="2c72cc50-6c69-4b16-b1f4-ab470673f284">
    <Name>cBots and Custom Indicators</Name>
    <Author>Spotware</Author>
    <Version>1.4</Version>
    <License>EULA.txt</License>
    <Description xml:space="preserve">Building cBots and Custom Indicators in Visual Studio</Description>
    <Locale>1033</Locale>
    <InstalledByMsi>false</InstalledByMsi>
    <SupportedProducts>
      <VisualStudio Version="10.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0">
        <Edition>Pro</Edition>
      </VisualStudio>
<VisualStudio Version="13.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="14.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.0">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.1">
  <Edition>Community</Edition>
</VisualStudio>
<VisualStudio Version="15.2">
  <Edition>Community</Edition>
</VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References>
    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
      <Name>Visual Studio MPF</Name>
    </Reference>
  </References>
  <Content>
    <VsPackage>VSExtension.pkgdef</VsPackage>
  </Content>
</Vsix>

Let us know if the above solves the problem.

Best Regards,

cTrader Team

Adding the reference to 15.2 fixed my problem with not being able to set the breakpoints....perfect.

I had been getting error "breakpoint will not currently be hit. No symbols have been loaded"


@warwick

helberg.andre@gmail.com
24 Aug 2019, 10:56

For anyone stumbling across this, here is a working extension for VS Community 2019 https://ah-public.s3-us-west-2.amazonaws.com/VSExtension-24-8-2019.vsix


@helberg.andre@gmail.com

lec0456
05 Apr 2021, 04:56

No symbols have been loaded for this document in VS 2019

I am using VS 2019 Enterprise and I get the message: "No symbols have been loaded for this document", for each break point I put in my bot.  I followed all the instructions in the cTrader Guide. So, whats the problem?


@lec0456

lec0456
05 Apr 2021, 05:19 ( Updated at: 05 Apr 2021, 07:05 )

RE: No symbols have been loaded for this document in VS 2019

lec0456 said:

I am using VS 2019 Enterprise and I get the message: "No symbols have been loaded for this document", for each break point I put in my bot.  I followed all the instructions in the cTrader Guide. So, whats the problem?

ok, I fixed it.  I uninstalled cTrader completely by removing the directories under the AppData\Roaming folder, but i don't think that was the key. I had previous versions of VS on my system from 2010/12/15 and 17.  I used the extension manager to install the cBot extension in VS2019. So, I uninstalled the extension. I did that for every version and edition.  Like I had 2019 Community and Enterprise and 2017 Community and enterprise. So, once I had the extensions all uninstalled. I went to cTrader and tried clicking edit in VS.  It did nothing. Didn't open VS or launch the extension installer.  So, from another post in the forum,I found a registry key in

HKCU\Software\\Microsoft\VisualStudio\11\ExtensionManager\EnabledExtensions\2c72cc50-6c69-4b16-b1f4-ab470673f284,1.6

that was preventing the installer from launching. Once I removed the key, the installer worked from cTrader.  Once, I had the extension reinstalled by cTrader, rather than from the VS extension manager, and I built the solution in VS, the debugger in VS 2019 worked. All the symbols loaded properly and the breakpoints are working.

The post from the other forum found the problem in a different registry key.

HKCU\Software\\Microsoft\VisualStudio\10\ExtensionManager\EnabledExtensions\2c72cc50-6c69-4b16-b1f4-ab470673f284,1.4

Must be leftover keys from previous installations. I don't how or why the old extensions that were installed affected a new install of VS2019 with the new cBot extension but apparently it had a problem. I don't think the reinstall of cTrader was necessary after al that but I was eliminating variables. Hope that helps someone.

 


@lec0456

lec0456
05 Apr 2021, 09:37

RE: RE: No symbols have been loaded for this document in VS 2019

lec0456 said:

lec0456 said:

I am using VS 2019 Enterprise and I get the message: "No symbols have been loaded for this document", for each break point I put in my bot.  I followed all the instructions in the cTrader Guide. So, whats the problem?

ok, I fixed it.  I uninstalled cTrader completely by removing the directories under the AppData\Roaming folder, but i don't think that was the key. I had previous versions of VS on my system from 2010/12/15 and 17.  I used the extension manager to install the cBot extension in VS2019. So, I uninstalled the extension. I did that for every version and edition.  Like I had 2019 Community and Enterprise and 2017 Community and enterprise. So, once I had the extensions all uninstalled. I went to cTrader and tried clicking edit in VS.  It did nothing. Didn't open VS or launch the extension installer.  So, from another post in the forum,I found a registry key in

HKCU\Software\\Microsoft\VisualStudio\11\ExtensionManager\EnabledExtensions\2c72cc50-6c69-4b16-b1f4-ab470673f284,1.6

that was preventing the installer from launching. Once I removed the key, the installer worked from cTrader.  Once, I had the extension reinstalled by cTrader, rather than from the VS extension manager, and I built the solution in VS, the debugger in VS 2019 worked. All the symbols loaded properly and the breakpoints are working.

The post from the other forum found the problem in a different registry key.

HKCU\Software\\Microsoft\VisualStudio\10\ExtensionManager\EnabledExtensions\2c72cc50-6c69-4b16-b1f4-ab470673f284,1.4

Must be leftover keys from previous installations. I don't how or why the old extensions that were installed affected a new install of VS2019 with the new cBot extension but apparently it had a problem. I don't think the reinstall of cTrader was necessary after al that but I was eliminating variables. Hope that helps someone.

 

OK, scratch that. While the above will help you if you can't trigger the VS installer from cTrader.  My problem with breakpoints not working and symbols not loading persisted.  The issue seems to be that VS2019 only loads the symbols if the Bot is running when you attach the process.  So, I have to start backtesting and THEN attach to process for the symbols to load and the breakpoints to work. This is NOT the way the cTrader Help Center describes the process. It specifically says to attach the process before running the bot.  But that won't work for me. So, either I am doing something wrong or the cTrader documentation is wrong. Or maybe it needs to be updated for changes in VS2019.  I would like a response from cTrader about this issue.


@lec0456

PanagiotisCharalampous
05 Apr 2021, 10:22

Hi lec0456,

I am running the process as per the documentation every day and it works fine for me. I build my project in VS 2019, I attach it to my process and then run my cBot/Indicator. Make sure that you only attach to the process only after the project has been built using VS 2019 i.e. if you build the project from cTrader after you have built it in VS, and then run the cBot, then the symbols will not be loaded. If you still follow the correct procedure and the problem persist, maybe ask in a Visual Studio related community as well what the issue could be.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous