Microsoft.ML.OnnxRuntime.NativeMethods Exception in Blazor MAUI Mac Catalyst
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- mobile-dev
Research direction
Start with the attached BlazorMAUI.zip sample and reproduce the failure by targeting net8.0-maccatalyst or net8.0-ios and clicking the Initialize Local Embeddings button. Trace the LocalEmbedder() initialization through Microsoft.ML.OnnxRuntime.NativeMethods and verify that it completes without the type-initializer exception on the reported simulator and device environments.
Written by the indexing model from the issue text.
Description
Description
When a .NET MAUI Blazor application includes the SmartComponents.LocalEmbeddings and Microsoft.ML.OnnxRuntime, the project throws an exception in intialization phase of LocalEmbedder localEmbedder = new LocalEmbedder(); in Mac Catalyst framework.
Have also tried placing the libonnxruntime.dylib in monobundle folder manually but still facing the mentioned exception. The version used for Microsoft.ML.OnnxRuntime is 1.22.1.
Steps to Reproduce:
- Create a new .NET MAUI Blazor project.
- Add the
SmartComponents.LocalEmbeddingsandMicrosoft.ML.OnnxRuntimeNuGet package. - Set the target to net8.0-ios or net8.0-maccatalyst.
- Create a onclick function in which initialze LocalEmbedder().
- Exception is getting thrown.
or
- Download the attached .NET MAUI Blazor project. BlazorMAUI.zip
- Run the sample.
- Click the Initialize Local Embeddings button
- Exception is getting thrown.
Expected Behavior:
During OnClick Event the initialization of LocalEmbedder() should take place correctly
Actual Behavior:
Initialization fails on Mac Catalyst throwing exception of The type initializer for "Microsoft.ML.OnnxRuntime.NativeMethods" threw an exception
Environment:
- .NET SDK: 8.0.203
- MAUI Version: 8.0.x
- macOS: macOS Sequoia 15.6
- Target Frameworks: net8.0-ios, net8.0-maccatalyst
- Device: Simulator and Physical Device
- SmartComponents.LocalEmbeddings Version: 0.1.0-preview10148
- Microsoft.ML.OnnxRuntime Version: 1.22.1
- Dominant language
- C#
- Stars
- 509
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/smartcomponents
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
dotnet/smartcomponents#51 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
dotnet/smartcomponents#50 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dotnet/smartcomponents#49 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
dotnet/smartcomponents#48 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
dotnet/smartcomponents#47 · 1 comment ·
All issues in dotnet/smartcomponents
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·