runtime: Dependency changes when building a self contained application in SDK version 8.0.303 to 8.0.401

Describe the bug

The library depedencies of our self-contained dotnet application change when building with version 8.0.401 instead of 8.0.303. As far as I can tell this should not be possible since it is a minor version change.

To Reproduce

We reproduce the issue by building our application with the follow command:

dotnet publish TestApplication/TestApplication.csproj -c Release -p:Version=$VERSION -o $CI_PROJECT_DIR/out/ -r linux-arm /p:PublishTrimmed=true --self-contained /p:PublishSingleFile=true -f net6.0

The docker image used is mcr.microsoft.com/dotnet/sdk:8.0. This image contains SDK version 8.0.401.

When running the application on our Linux device, we run into the following error: ./TestApplication: /lib/libc.so.6: version 'GLIBC_2.27' not found (required by ./TestApplication)

But when we build with image: mcr.microsoft.com/dotnet/sdk@sha256:e9f45219cca08134f09cb973de3e8364d5a22ad30dfff1343830003c6494a735 This error does NOT occur, this image uses SDK version 8.0.303.

It is not easily reproduce able since it is a non-public Linux distribution. Let me know if any more information is required.

Further technical details

  • output of uname -a on our device: Linux FX96006B9E16 4.9.182-rt131-yocto-standard dotnet/sdk#1 PREEMPT Mon Aug 14 11:47:31 IST 2023 armv7l GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

does this fix also apply for dotnet sdk 8.0.404? or am I missing something? we use the -f net6.0 flag to build the app

Your SDK version should be fine for building with -f net6.0, but without updating your .NET 6 runtime version to 6.0.36, I would expect you to get the same error as above (./TestApplication: /lib/libc.so.6: version 'GLIBC_2.27' not found (required by ./TestApplication)) when you try to run your app. Could you please install the latest .NET 6 runtime, rerun your application, and let me know how it goes? Thanks!

I just tested the new runtime and the application now runs without any issues. So the issue is resolved for us. Thanks again for the quick reply and for fixing this issue.

That would be great! thanks for solving this in such a promptly manner.

The fix should be included in the .NET Runtime 6.0.36 release. If you’d like, I can ping you here once it’s available.