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
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