Skip to content

.NET 8 Preview 5: Android Release builds no longer work #32539

@jonathanpeppers

Description

@jonathanpeppers

Describe the bug

Likely due to the new default for $(SelfContained): #30038

Any Android Release build fails, because it is trying to not be self-contained:

error XALNS7028: System.IO.FileNotFoundException: Could not load assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Perhaps it doesn't exist in the Mono for Android profile?

Android Release builds are somewhat unique because they have these settings by default:

  • SelfContained=true
  • RuntimeIdentifier= (blank)
  • RuntimeIdentifiers=android-arm;android-arm64;android-x86;android-x64

macOS/MacCatalyst applications may hit a similar issue, but I haven't heard yet.

To Reproduce

  • install the SDK from main/nightly
  • dotnet workload install android
  • dotnet new android
  • dotnet build -c Release

Exceptions (if any)

After setting SelfContained=true by default, it tried to use the host RID:

error NETSDK1082: There was no runtime pack for Microsoft.Android available for the specified RuntimeIdentifier 'osx-x64'.

After setting UseCurrentRuntimeIdentifier=false, it fails with:

error NETSDK1191: A runtime identifier for the property 'SelfContained' couldn't be inferred. Specify a rid explicitly. 

Further technical details

This blocks MAUI scenarios for .NET 8 Preview 5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions