aspnetcore: Cannot build ASP.NET Core 7 app for Raspberry Pi 4
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Hey 👋🏻
I’ve been using the Docker image mu88/shopandeat:latest (an ASP.NET Core app) for years on my Raspberry Pi 4. One month ago, I switched to ASP NET Core 7.0 and everything worked smoothly.
Last week I made a little fix in the app and created a new version of mu88/shopandeat:latest. When trying to pull this image on my Raspi via docker pull mu88/shopandeat:latest, this fails with:
latest: Pulling from mu88/shopandeat
no matching manifest for linux/arm64/v8 in the manifest list entries
Which is strange because when logging into Docker Hub it seems to be okay:

I’m building my app via GitHub Actions:
So I’ve opened this issue in the Docker community forum. After some back and forth we discovered that when setting the platform parameter for docker build to linux/arm64 or linux/arm64/v8, dotnet build fails with cryptic errors in the .NET compilation part of my Dockerfile:
#18 [build 12/12] RUN dotnet build "ShopAndEat.csproj" -c Release -o /app/build
#18 5.256 MSBuild version 17.4.1+9a89d02ff for .NET
#18 14.52 Determining projects to restore...
#18 27.92 All projects are up-to-date for restore.
#18 32.74 /usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(120,5): error MSB4018: The "AllowEmptyTelemetry" task failed unexpectedly. [/src/BizLogic/BizLogic.csproj]
#18 32.74 /usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(120,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [/src/BizLogic/BizLogic.csproj]
#18 32.75 /usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(120,5): error MSB4018: at InvokeStub_AllowEmptyTelemetry.set_EventData(Object, Object, IntPtr*) [/src/BizLogic/BizLogic.csproj]
#18 32.75 /usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(120,5): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) [/src/BizLogic/BizLogic.csproj]
#18 32.75 /usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(120,58): error MSB4026: The "EventData=TargetFrameworkVersion=$([MSBuild]::Escape('$(TargetFrameworkMoniker)'));RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(SelfContained);UseApphost=$(UseApphost);OutputType=$(OutputType)" parameter for the "AllowEmptyTelemetry" task is invalid. [/src/BizLogic/BizLogic.csproj]
I’ve attached the GitHub Actions build log.
Expected Behavior
I can build my ASP.NET Core app on GitHub Actions, set the latest tag on Docker Hub, pull it onto my Raspberry Pi 4 and successfully start the app.
Steps To Reproduce
- Create an environment similar to GitHub Actions
- Run the CI pipeline
CI.yml
Exceptions (if any)
The following error occurs when build the Docker image via GitHub Actions with --platform linux/arm64:
#15 20.77 /usr/share/dotnet/sdk/7.0.102/NuGet.targets(1179,7): error MSB4018: The "MSBuild" task failed unexpectedly. [/src/DataLayer/DataLayer.csproj]
#15 20.77 /usr/share/dotnet/sdk/7.0.102/NuGet.targets(1179,7): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [/src/DataLayer/DataLayer.csproj]
#15 20.77 /usr/share/dotnet/sdk/7.0.102/NuGet.targets(1179,7): error MSB4018: at InvokeStub_MSBuild.get_TargetOutputs(Object, Object, IntPtr*) [/src/DataLayer/DataLayer.csproj]
#15 20.77 /usr/share/dotnet/sdk/7.0.102/NuGet.targets(1179,7): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) [/src/DataLayer/DataLayer.csproj]
.NET Version
7.0.102
Anything else?
- Platform information:
- Hardware: Raspberry Pi 4
- OS: Raspberry Pi OS / x64 / 11 (bullseye)
- Docker version 20.10.23, build 7155243
- ASP.NET Core 7
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (10 by maintainers)
No worries. All good. I really appreciate you reporting the issue. I think our guidance is actually a bit wrong so I’m going to work on that now, so thanks for the insight on that.
https://github.com/mu88/ShopAndEat/pull/36