Ctrader .algo file is not picking up a successfull vs2022 build.

Created at 28 Mar 2023, 18:03
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

Shares4us

Joined 01.04.2020

Ctrader .algo file is not picking up a successfull vs2022 build.
28 Mar 2023, 18:03


Suddenly cTrader is not picking up a successfull build from vs2022 anymore.

if I build in cTrader changes to the source will reflect in the executed bot.
If I then change and build in vs2022 changes are not reflected in the executed bot.

cAlgo\Sources\Robots\CBOTName\CBOTName\bin\Debug\net6.0\CBOTName.dll & 
cAlgo\Sources\Robots\CBOTName\CBOTName\bin\Debug\net6.0\CBOTName.pdb &
cAlgo\Sources\Robots\CBOTName\CBOTName.cs 


are updated
but the

cAlgo\Sources\Robots\CBOTName\CBOTName.algo 

stays unalterred therfor the changes are not in the executable

What is wrong in some settings somewhere?
How to instruct vs2022 to also create the .algo file?


@Shares4us
Replies

Spotware
29 Mar 2023, 14:29 ( Updated at: 31 Mar 2023, 12:01 )

Dear trader,

Can you please try cleaning and restoring all NuGet packages and try again?

Best regards,

cTrader Team


 


@Spotware

Shares4us
30 Mar 2023, 15:28 ( Updated at: 30 Mar 2023, 15:30 )

RE:

Hi, thanks for caring!

I already tried that a few times, No avail!
Still *.algo is not updated.

using cTrader.Automate 1.0.6
No other Nuget Packages


@Shares4us

Shares4us
30 Mar 2023, 19:12 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE:

reinstalled vs2022 (uninstall -> Install)

Uninstalled cTrader
Installed cTrader 4.6.5.14861
 
1. In cTrader: Made new indicator

2. In cTrader: Clicked Edit in Visuals Studio.

3, In VS2022: Alter  Print statement in initialize.

4, In VS2022:Build => Build OK.

5: Back to cTrader.

6: In cTrader: Source shows new Print Statement.
                      But does not show it build successfully
 




Greece, We have a problem!
 


@Shares4us

PanagiotisChar
31 Mar 2023, 09:07

Hi,

Any chance you have this property configured in your .csproj file?

<PropertyGroup>
  <AlgoBuild>False</AlgoBuild>
</PropertyGroup>

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

Shares4us
31 Mar 2023, 10:43 ( Updated at: 31 Mar 2023, 10:44 )

RE:

PanagiotisChar said:

Hi,

Any chance you have this property configured in your .csproj file?

<PropertyGroup>
  <AlgoBuild>False</AlgoBuild>
</PropertyGroup>

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

nope
I added 
 <PropertyGroup>
     <AlgoBuild>True</AlgoBuild>
  </PropertyGroup>

did not work either.

I think it has nothing to do with the solution nor project.
All projects suffer from this.
Even uninstalled cAlgo,  renamed documents/calgo and installed again.
Did not work,
I noticed that after the install the sources/robots and sources/indicators folders where empty?? No samples!


@Shares4us

Shares4us
31 Mar 2023, 11:57

RE: RE:

I reverted to VS2017 just to check.
Did not work either!

 


@Shares4us

Spotware
31 Mar 2023, 12:02

Dear trader,

Can you please advise if you are using a Mac?

Best regards,

cTrader Team


@Spotware

Shares4us
31 Mar 2023, 13:19

RE:

Edition    Windows 11 Pro
Version    22H2
 OS build    22621.1413

 

On a Intel(R) Core(TM) i9-9900K CPU  


@Shares4us

Spotware
31 Mar 2023, 13:24

Dear trader,

Can you please confirm this is native Windows installation and not Windows running on a Mac?

Best regards,

cTrader Team


@Spotware

Shares4us
31 Mar 2023, 13:43

RE:

native, No Apples here !

 


@Shares4us

Spotware
03 Apr 2023, 12:04

Dear trader,

Unfortunately we were not able to reproduce this problem on Windows machine yet. It seems to be a Visual Studio issue. Could you please try building your project using the dotnet build command and let us know if it resolves the problem?

Best regards,

cTrader Team


@Spotware

Shares4us
03 Apr 2023, 14:35

RE:

Spotware said:

Dear trader,

Unfortunately we were not able to reproduce this problem on Windows machine yet. It seems to be a Visual Studio issue. Could you please try building your project using the dotnet build command and let us know if it resolves the problem?

Best regards,

cTrader Team

Tried, no avail. 
Only embedded builds OK (but no debug possibilities) and writes the .algo file
using sdk builds OK but does not write the .algo file
 


@Shares4us

Shares4us
05 Apr 2023, 08:44

RE:

maybe i'm doing the wrong params in the .net build.
Can you give an example of the command you'd like me to execute?

 


@Shares4us

Spotware
05 Apr 2023, 09:50

Dear Share4us,

The command is the following

dotnet build --configuration Release

Best regards,

cTrader Team


@Spotware

Shares4us
05 Apr 2023, 13:37

RE:

OK if not more params than the result will be the same.
 

Build project -> build OK but no .algo file
Build solution -> build OK but no .algo file

More info:

PS C:\Users\test\documents\calgo\sources\robots\xxx > dotnet build --configuration Release
MSBuild version 17.5.0+6f08c67f3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  xxx1 -> C:\Users\test\documents\calgo\sources\Indicators\xxx1\xxx1\bin\Release\net6.0\xxx1.dll
  xxx -> C:\Users\test\documents\calgo\sources\robots\xxx\xxx\bin\Release\net6.0\xxx .dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.24

- - - -- -
 

PS C:\Users\test\documents\calgo\sources\robots\xxx > dotnet --info
.NET SDK:
 Version:   7.0.202
 Commit:    6c74320bc3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.202\

Host:
  Version:      7.0.4
  Architecture: x64
  Commit:       0a396acafe

.NET SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.512 [C:\Program Files\dotnet\sdk]
  2.1.526 [C:\Program Files\dotnet\sdk]
  2.2.109 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]
  3.1.403 [C:\Program Files\dotnet\sdk]
  3.1.426 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  6.0.115 [C:\Program Files\dotnet\sdk]
  6.0.202 [C:\Program Files\dotnet\sdk]
  6.0.203 [C:\Program Files\dotnet\sdk]
  6.0.302 [C:\Program Files\dotnet\sdk]
  6.0.310 [C:\Program Files\dotnet\sdk]
  7.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  arm64 [C:\Program Files\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found


@Shares4us

Shares4us
10 Apr 2023, 13:28

RE:

please provide me with a 'something' to create the .algo file

 


@Shares4us

firemyst
10 Apr 2023, 15:39 ( Updated at: 10 Apr 2023, 15:43 )

RE: RE:

Shares4us said:

please provide me with a 'something' to create the .algo file

 

Can you post your Indicator code, or some sort of sampling there of, that's causing the issue? So someone else can try building your code to see if it works?


@firemyst

firemyst
10 Apr 2023, 15:42 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE:

Shares4us said:

please provide me with a 'something' to create the .algo file

 

And just to confirm, you are looking under the "Automate" tab (since your screen capture from earlier shows it to be an indicator and not a cbot) and you have everything being shown?


@firemyst

Shares4us
12 Apr 2023, 12:00 ( Updated at: 12 Apr 2023, 12:24 )

RE: RE: RE:

@firemyst 

Yes i'm on the automate tab (see the post on 30 Mar 2023, 19:36)
Yes it's an indicator, the problem is the same for an indicator or a Robot.
The problem is not in the use of the cTrader native build but in building with vs2022.

The build in vs2022 runs OK 

Build started...
1>------ Build started: Project: Test3, Configuration: Debug Any CPU ------
1>Test3 -> C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3\Test3\bin\Debug\net6.0\Test3.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 10:53 AM and took 01.701 seconds ==========

but the

C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3.algo

is not updated.

therefor debugging is not possible.

So the question is:
What 'extentions/procedures' does cTrader append to vs2022 to create/update the Test3.algo file and what makes it not working anymore.

 


@Shares4us

firemyst
12 Apr 2023, 12:54

RE: RE: RE: RE:

Shares4us said:

@firemyst 

Yes i'm on the automate tab (see the post on 30 Mar 2023, 19:36)
Yes it's an indicator, the problem is the same for an indicator or a Robot.
The problem is not in the use of the cTrader native build but in building with vs2022.

The build in vs2022 runs OK 

Build started...
1>------ Build started: Project: Test3, Configuration: Debug Any CPU ------
1>Test3 -> C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3\Test3\bin\Debug\net6.0\Test3.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 10:53 AM and took 01.701 seconds ==========

but the

C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3.algo

is not updated.

therefor debugging is not possible.

So the question is:
What 'extentions/procedures' does cTrader append to vs2022 to create/update the Test3.algo file and what makes it not working anymore.

 

If you have anything specified in VS 2022 like preferred framework, target platform, target OS, etc etc, it's going to build it in those local subfolders under "Bin" and "release/debug".

To stop this, you need to edit your VS Project file (via Notepad or some other text editor) and insert the following within the <PropertyGroup> tags:

    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

For example, here's mine from one project using .Net6:

<PropertyGroup>
    <TargetFramework>net6.0-windows10.0.20348.0</TargetFramework>
    <PlatformTarget>x64</PlatformTarget>
	<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
	<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  </PropertyGroup>

 

 


@firemyst

Shares4us
13 Apr 2023, 18:20

RE: RE: RE: RE: RE:

@firemyst  

Thnks for the effort!

But sadly it does not change the fact it still builds no .algo file

 


@Shares4us

firemyst
14 Apr 2023, 02:51

RE: RE: RE: RE: RE: RE:

Shares4us said:

@firemyst  

Thnks for the effort!

But sadly it does not change the fact it still builds no .algo file

 

That's unfortunate.

But you still havne't posted sample code that "doesn't build" so others cna try reproducing the issue?

According to your logs, it does build the calgo, but into the various C:\Users\Admin\Documents\cAlgo\Sources\Indicators\ [name of indicator] \bin\Release subfolders.

 

 


@firemyst

Shares4us
15 Apr 2023, 16:18

RE: RE: RE: RE: RE: RE: RE:

@firemyst

But you still havne't posted sample code that "doesn't build" so others cna try reproducing the issue?

?????? What use has code when the problem is not syntactical or in the logic but in the dev environment itself!
If it was I'd posted (as many times before) a test code to prove the problem.
Please look at the images I posted in my inital post. Think about it and you will come to the conclusion it has NOTHING to do with code!

Best rgds,


@Shares4us

firemyst
16 Apr 2023, 05:35

RE: RE: RE: RE: RE: RE: RE: RE:

Shares4us said:

@firemyst

But you still havne't posted sample code that "doesn't build" so others cna try reproducing the issue?

?????? What use has code when the problem is not syntactical or in the logic but in the dev environment itself!
If it was I'd posted (as many times before) a test code to prove the problem.
Please look at the images I posted in my inital post. Think about it and you will come to the conclusion it has NOTHING to do with code!

Best rgds,

All I'm suggesting is nobody else appears to be experiencing any issues running various versions of cTrader and building numerous indicators/cbots.

So to encourage people to further help you, you'll have to give people something else to go on.

That means code, the .sln file, the .csproj file, the .algo file, or everything.

Or some sampling that reproduces the issue so others can see what's happening, investigate, and perhaps give you an answer.

If you're not willing to do that, then you might be on your own.

 


@firemyst

Shares4us
23 Apr 2023, 20:16

RE: RE: RE: RE: RE: RE: RE: RE: RE:

@firemyst said:

If you're not willing to do that, then you might be on your own.

yes. it feels like that; It seems no-one understands that it is NOT IN THE CODE, (every cbot/indicator had the same problem)
It is in the way vs2022 builds, because that is where the cAlgo file is written.

But I uninstalled ctrader and uninstalled vs2022 then reinstalled everything and it still did not work.
Then i reinstalled windows (cleaninstall) and the rest and it still did not work.

Then cTrader.Automate 1.7 was released and now it works again!.

It is a pitty we will probably never know why it failed but Spotware knows because they silently fixed it in 1.7.

case closed.


@Shares4us

Shares4UsDevelopment
04 Apr 2024, 15:07

RE: RE: RE: RE: RE: RE: RE: RE: RE: RE:

Shares4us said: 

It is a pitty we will probably never know why it failed but Spotware knows because they silently fixed it in 1.7.

case closed.

And now it;s back in automate 1.8 !!!!!!


@Shares4UsDevelopment

BernhardCS
24 Oct 2024, 01:53

RE: RE: RE: RE: RE: RE: RE: RE: RE: RE: RE:

I made an external lib, which needs access to cAlgo, while compiling I got the error: “CT0002 Assembly must contain algo type.” and according to the forum that should be added to the lib project file:

    <PropertyGroup>
    <AlgoBuild>False</AlgoBuild>
   </PropertyGroup>

Problem was that the error: “CT0002 Assembly must contain algo type.” is referenced (double click on error) to a completely different file: C:\Users\[USER_NAME]\.nuget\packages\ctrader.automate\1.0.9\build\cTrader.Automate.targets where I added the PropertyGroup above by mistake, with the result that algo files will not be made anymore (for all bots and indicators) and also the compiler error disappeared. At first it looked ok for me … but then I got crazy to find the file where I made the mistake ;-)

However, the file C:\Users\[USER_NAME]\.nuget\packages\ctrader.automate\1.0.9\build\cTrader.Automate.targets will be replaced by each update and maybe that would be also the solution for the problems mentioned by the others in that thread?!


@BernhardCS