Skip to content

build/create fail on Linux image: false "requires the .NET SDK" / "not implemented" even with a confirmed-working SDK and real credentials #16

Description

@Xerkury

ctrader-console (ghcr.io/spotware/ctrader-console) — build command fails with "requires the .NET SDK" even when the SDK is present

Environment

  • Image: ghcr.io/spotware/ctrader-console:latest (Debian 11 "bullseye" base)
  • Host: macOS, Apple Silicon (arm64), Docker Desktop
  • cTID/account: real, authenticated successfully (login and account selection both work)

Summary

build <project-path> unconditionally fails with:

Building an algorithm that references NuGet packages requires the .NET SDK,
which was not found on this machine. Install the .NET 6 SDK and try again.

even after building a custom image that layers a confirmed-working .NET 6 SDK
on top of the base ctrader-console image.

Steps to reproduce

  1. Custom Dockerfile:
    FROM ghcr.io/spotware/ctrader-console:latest
    USER root
    RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
        && curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \
        && bash /tmp/dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet \
        && rm /tmp/dotnet-install.sh \
        && apt-get purge -y curl && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
    ENV PATH="/usr/share/dotnet:${PATH}"
    ENV DOTNET_ROOT="/usr/share/dotnet"
  2. Confirm the SDK is genuinely present and on PATH/DOTNET_ROOT inside the built image:
    $ docker run --rm --entrypoint sh algofactory-ctrader-builder -c 'dotnet --list-sdks'
    6.0.428 [/usr/share/dotnet/sdk]
    
  3. A minimal cBot project referencing the NuGet cAlgo.API package:
    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <OutputType>Library</OutputType>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="cAlgo.API" Version="*" />
      </ItemGroup>
    </Project>
  4. Run the build:
    docker run --rm -v <project-dir>:/app/work -v <pwd-file>:/app/pwd_file:ro \
      algofactory-ctrader-builder build --ctid=<ctid> --pwd-file=/app/pwd_file \
      --account=<account> --project-path=work -q
    
  5. Output — login succeeds, then:
    {
      "projectPath": "/app/work/<name>.csproj",
      "success": false,
      "errorCode": null,
      "errors": [
        {
          "file": null, "line": -1, "column": -1, "code": null,
          "text": "Building an algorithm that references NuGet packages requires the .NET SDK, which was not found on this machine. Install the .NET 6 SDK and try again."
        }
      ],
      "warnings": []
    }

Additional finding

strace -f -e trace=execve,stat,access,openat across the whole build invocation
shows no attempt by the process to locate/probe for a dotnet executable or SDK
directory beyond the app's own startup framework resolution (/usr/share/dotnet/host/fxr,
needed just to launch ctrader-cli.dll itself). This suggests the SDK-availability
check that gates NuGet-referencing builds isn't actually querying the filesystem/PATH
on Linux — it may be a hardcoded/Windows-only check (e.g. via Microsoft.Build.Locator
querying Visual Studio instances, which has no Linux equivalent) that always reports
"not found" regardless of what's actually installed in the container.

Also tried, for completeness

Bypassing NuGet entirely and referencing the already-bundled /app/cAlgo.API.dll
directly via a plain MSBuild <Reference> (no PackageReference) instead:

<Reference Include="cAlgo.API">
  <HintPath>../cAlgo.API.dll</HintPath>
  <Private>false</Private>
</Reference>

This avoids the SDK check but fails differently:

Error: Build failed: The method or operation is not implemented.

Likewise, create <cbot|indicator|plugin> <name> <language> (project scaffolding)
returns the same "not implemented" error on this Linux image.

Ask

Is local project compilation (build, create) for cBots actually supported on
the Linux build of ctrader-console, or is this currently Windows-only despite
being present in --commands/--help? If it should work on Linux, what's the
correct way to make the SDK discoverable to the build engine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions