Skip to content

'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception #23300

@Sriharsha-medevplus

Description

@Sriharsha-medevplus

Describe the issue

I have installed OnnxRuntime for C# using the NuGet package manager, it is working fine with my device.
but when I try to install the .net application with the model in other PC's I get: error loading image: The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.

Object reference not set to an instance of an object.
at Microsoft.ML.OnnxRuntime.NativeMethods..cctor() in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\NativeMethods.shared.cs:line 368

To reproduce

Image

Urgency

No response

Platform

Windows

OS Version

11/ 10

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.20.1

ONNX Runtime API

C#

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeapi:CSharpissues related to the C# APIstaleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions