Skip to content

singlefile and selfcontained linux-bionic-arm64 (aka in Termux on Android ) binaries aren't actually selfcontained properly #130992

Closed

Description

@TheKingFireS

Description

I built this project with dotnet-11 (to see if it's fixed or not), it output singlefile and selfcontained binary, but I noticed that size is abnormally low size (11mb instead of supposed ~30mb).

Reproduction Steps

  1. Clone this repo:
    https://github.com/SteamRE/DepotDownloader.git

  2. Then edit these files to override dotnet project version (important!):
    DepotDownloader/DepotDownloader.csproj
    global.json

  3. Run this command to have exact same binary as me:
    dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-bionic-arm64 --output selfcontained-linux-bionic-arm64

  4. Transfer selfcontained-linux-bionic-arm64/DepotDownloader file to Termux installed on your phone.

  5. Execute this command:
    ./DepotDownloader

Bonus: After you dev teams fixed singlefile issue, binary won't run without some missing file located in /system/*/, please switch to $PREFIX/*/ instead (see more info at bottom of this page).

Expected behavior

To have bundled and working singlefile and selfcontained binary.

Actual behavior

Instead It have unbundled and non-working singlefile and selfcontained binary that output this:

You must install .NET to run this application.

App: /data/data/com.termux/files/home/DepotDownloader
Architecture: arm64
App host version: 11.0.0-preview.5.26302.115
.NET location: Not found

The following locations were searched:
  Application directory:
    /data/data/com.termux/files/home/
  Environment variable:
    DOTNET_ROOT_ARM64 = <not set>
    DOTNET_ROOT = <not set>
  Registered location:
    /etc/dotnet/install_location_arm64 = <not set>
  Default location:
    /usr/share/dotnet

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=arm64&rid=linux-bionic-arm64&os=linux-bionic&apphost_version=11.0.0-preview.5.26302.115

Regression?

Nope, it's same on dotnet-9, 10 and now 11-preview. (dotnet-8 doesn't have singlefile support for linux-bionic-arm64)

Known Workarounds

Don't build singlefile and selfcontained binaries, instead build normal selfcontained binaries without singlefile. (Currently broken for dotnet-9 and dotnet-10, build using Termux and its dotnet* packages instead)

Configuration

  1. The DepotDownloader repo is written for dotnet-9, latest SteamKit (library used by DD) repo is written for dotnet-10. I forced it to be built with dotnet-11 (to see if singlefile and selfcontained bug is fixed.)

  2. linux-bionic-arm64 aka Termux on Android.

  3. arm64, built binary with my x64 PC, tested binary with my arm64 phone.

  4. Huh?

Other information

By the way, please don't look for libssl in /system/lib*/, instead look for Termux's $PREFIX/lib/. I used $PREFIX because you can build your Termux with different data path which rendered compatibility issues for dotnet-built binaries that look for absolute path of Termux such as /data/data/com.termux/files/usr.

Also please take a look into this awesome Termux package and their patches :)
https://github.com/termux/termux-packages/tree/d80e46464959131c9301dae48f5e6b78f96a8be3/packages/dotnet10.0

Activity

  1. added
    untriaged
    on Jul 17, 2026
  2. dotnet-policy-service commented on Jul 17, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @elinor-fung, @VSadov
    See info in area-owners.md if you want to be subscribed.

  3. dotnet-policy-service commented on Jul 18, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  4. elinor-fung commented on Jul 20, 2026

    @elinor-fung
    Member

    it output singlefile and selfcontained binary, but I noticed that size is abnormally low size

    We don't include singlefilehost in shipped packs for linux-bionic:

    <ItemGroup Condition="'$(RuntimeFlavor)' != 'Mono' and '$(TargetsLinuxBionic)' != 'true'">
    <NativeRuntimeAsset Include="$(DotNetHostBinDir)/singlefilehost$(ExeSuffix)" />
    </ItemGroup>

    Looks like the condition was added in #111136 - @jkoritzinsky was that portion of the change specifically intended as 'we don't support linux-bionic singlefilehost'?

    Separately, the SDK should probably be updated to not just silently use apphost if it can't find singlefilehost.

  5. jkoritzinsky commented on Jul 20, 2026

    @jkoritzinsky
    Member

    At the time of #111136, we weren't shipping (or even building) the CoreCLR stack for linux-bionic, so we didn't have a single file host at the time.

    Now, we can remove that restriction with our CoreCLR-on-Android work.

  6. jkoritzinsky commented on Jul 20, 2026

    @jkoritzinsky
    Member

    Looks like we currently don't build CoreCLR for linux-bionic (likely just because we didn't enable it).

    I'll get that hooked up.

  7. removed
    untriaged
    on Jul 22, 2026
  8. added this to the 11.0.0 milestone on Jul 22, 2026
  9. locked and limited conversation to collaborators on Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions