Skip to content

[NAOT][android] System.Diagnostics.Debug.Tests fails to build #120722

@sbomer

Description

@sbomer

Building this test for nativeaot android gives errors like the following:

/src/tasks/AndroidAppBuilder/Templates/monodroid-nativeaot.cs(45,6): error CS0433: The type 'LibraryImportAttribute' exists in both 'System.Runtime.InteropServices, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' [/home/sven/src/runtime/src/libraries/System.Runtime/tests/System.Diagnostics.Debug.Tests/System.Diagnostics.Debug.Tests.csproj::TargetFramework=net10.0-unix]

This seems to be caused by a corelib reference in the test project. According to #73792 (comment) this should ideally be removed, but the test project needs a type from corelib:

    <!-- Some tests need types like System.Diagnostics.DebugProvider which are only exposed from System.Private.CoreLib -->
    <CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions