Cannot compile class libraries (.Net 6.0) when referencing cTrader.Automate package
Cannot compile class libraries (.Net 6.0) when referencing cTrader.Automate package
31 Mar 2022, 16:08
When trying to convert class libraries over to .net 6.0 and build them I'm running into a problem with the embedded targets file trying to search for a Robot or Indicator.
1>C:\Users\User\.nuget\packages\ctrader.automate\1.0.0\build\cTrader.Automate.targets(35,9): error CT0002: Assembly must contain algo type.
The libraries are just that libraries, they don't implement the Robot or Indicators directly as they're consumed in other projects which deal with that step. Is there a way to bypass the algo packaging steps to work around the problem?
Replies
patrock333
20 May 2023, 23:47
RE:
YrpWayne said:
<PropertyGroup> <AlgoBuild>False</AlgoBuild> </PropertyGroup>
Hope that helps someone else.
Thanks for this.
I couldn't find a solution anywhere to get rid of that error.
It took me a while to figure out how to add this to my csproj file, I'm new to C# and Visual Studio.
I just added it in C:\...\.nuget\packages\ctrader.automate\1.0.7\build\cTrader.Automate.targets.
@patrock333
jaco.semko
27 Dec 2024, 15:38
( Updated at: 30 Dec 2024, 07:15 )
RE: RE:
patrock333 said:
YrpWayne said:
<PropertyGroup> <AlgoBuild>False</AlgoBuild></PropertyGroup>
Hope that helps someone else.
Thanks for this.
I couldn't find a solution anywhere to get rid of that error.
It took me a while to figure out how to add this to my csproj file, I'm new to C# and Visual Studio.
I just added it in C:\...\.nuget\packages\ctrader.automate\1.0.7\build\cTrader.Automate.targets.
Good morning. I am new right now to all of this. Did it change something? Why would you need to put it in this directory? I tried it at some different spots, but still got the “error CT0002: Assembly must contain algo type.” I appreciate the help. I also tried it already to put it into the .csproj-file, but it still ddnt work… Thank you,
Best regards
Jacob
@jaco.semko
YrpWayne
31 Mar 2022, 16:13
Never mind, figured out there's a property that can be set which bypasses the build.
Add the below snippet to your library .csproj file:
Hope that helps someone else.
@YrpWayne