C#C
C#10mo ago
Tiger

MAUI runtime identifier build hell

I have a class library that requires me to put in an RID to build it.
To build one of the projects on windows I need to set the win-x64 RID
However when I build a MAUI project on android, I need the android-arm64 RID

I have set these:
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('windows'))">win-x64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'net9.0-android'">android-arm64</RuntimeIdentifiers>


Now it builds fine, but when I build the MAUI project it doesn't build it in a sub-directory for android-arm64, when I build the class lib using dotnet build -f net9.0-android -r android-arm64 then the sub-directory is created.

so basically, the MAUI app is looking for the sub-directory that has the RID but that directory does not exist.

The MAUI build also works fine when I do the command dotnet build -f net9.0-android -r android-arm64
Was this page helpful?