Skip to content

Unable to use ONNX: Reference to type 'ReadOnlySpan<>' claims it is defined in 'mscorlib', but it could not be found #5078

Closed as not planned

Description

Description

I am unable to use Microsoft.ML.OnnxRuntime.Managed with MAUI, it works on a regular net6.0 library, and latest Xamarin Forms.
Error: Reference to type 'ReadOnlySpan<>' claims it is defined in 'mscorlib', but it could not be found

Steps to Reproduce

  1. Create a new MAUI project, Android is what I tested on
  2. Add Nuget reference to Microsoft.ML.OnnxRuntime.Managed and Microsoft.ML.OnnxRuntime
  3. Add workaround for a different ONNX bug: net6.0-android generated sources compile error(don't support covariant for return value ) #3867 (comment)
  4. Add this code somewhere: new DenseTensor<float>(4);

Version with bug

Preview 13 (current)

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

Android

Did you find any workaround?

No

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureCI, Maestro / Coherency, upstream dependencies/versionsplatform/android 🤖s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions