You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run publish dotnet publish -f net9.0 -r linux-arm64 -c Release
Exception:
error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative
Real scenario
In our production we have used a docker container for cross compiling.
Following script is incompatible with latest docker images (9.0-noble) and there is no documentation provided how to enable cross compilation on that image.
I have also tried directly to use the 9.0-noble-arm container ... but I get an exception wheb executing dotnet publish.
sudo dpkg --add-architecture arm64 sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse EOF' sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list sudo apt update sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64
I have the same issue on WSL (Ubuntu 24.04.1 LTS). It works fine to compile linux-x64, but linux-arm64 build fails with:
> dotnet publish -c Release -r linux-x64 --self-contained
Restore complete (1.2s)
WebApplication6 succeeded (32.0s) → bin/Release/net9.0/linux-x64/publish/
Build succeeded in 34.3s
> dotnet publish -c Release -r linux-arm64 --self-contained
Restore complete (1.0s)
WebApplication6 failed with 1 error(s) (2.9s) → bin/Release/net9.0/linux-arm64/WebApplication6.dll
/home/ladeak/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.0/build/Microsoft.NETCore.Native.Publish.targets(77,5): error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative
Build failed with 1 error(s) in 4.9s
I am on Win11 x64 (Intel). I would expect it to work, as it works on Windows (targeting the same source to win-arm64) <PublishAot> is set in the csproj. ASP.NET Core minimal APIs app.
In dotnet9 is cross compilation still supported on Ubuntu? What is required?
Steps to reproduce
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/cross-compile#linux
dotnet new webapiaot
dotnet publish -f net9.0 -r linux-arm64 -c Release
Exception:
error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative
Real scenario
In our production we have used a docker container for cross compiling.
Following script is incompatible with latest docker images (9.0-noble) and there is no documentation provided how to enable cross compilation on that image.
I have also tried directly to use the 9.0-noble-arm container ... but I get an exception wheb executing dotnet publish.
sudo dpkg --add-architecture arm64 sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse EOF' sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list sudo apt update sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64
Environment
.NET SDK:
Version: 9.0.100
Commit: a2bc464e40
Workload version: 9.0.100-manifests.6bf02610
MSBuild version: 17.12.7+a2bc464e4
Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
The text was updated successfully, but these errors were encountered: