How to build with dotnet for linux-arm64 on a windows 11 x64 PC?

ikki 10 Reputation points
2023-04-23T03:24:43.46+00:00

Hi, I have a C# source code (from Terraria/tModLoader (https://github.com/tModLoader/tModLoader/wiki/tModLoader-guide-for-contributors)) that is originally built for x86/x64 and I would like to compile it to linux-arm64. The project is originally set to AnyCPU for the platform. Therefore, I thought I could set the runtime identifier with linux-arm64 with the command dotnet build "../src/tModLoader/Terraria/Terraria.csproj" -c Release -r linux-arm64 -v q /clp:ErrorsOnly will work. However, the following error occurred: Microsoft.NET.RuntimeIdentifierInference.targets(157,5): error NETSDK1067: Self-contained applications are required to use the application host. Either set SelfContained to false or set UseAppHost to true. Is there any hint that I can try to fix the problem to compile the source code that can work on linux-arm64? Thank you very much for your great help.

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
326 questions
{count} votes