EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'

akhil patel 1 Reputation point

I am trying to run an sklearn onnx model in C# 4.8 framework on Windows 10 Pro with VS 2019, I have used the following code using examples in:





I also have looked at a similar answer here:


I have imported using nuget

Install-Package Microsoft.ML.OnnxRuntime -Version 1.9.0
Install-Package Microsoft.ML.OnnxRuntime.Gpu -Version 1.9.0
Install-Package Microsoft.ML.OnnxTransformer -Version 1.6.0
Install-Package Microsoft.ML.OnnxRuntime.MKLML -Version 1.6.0
Install-Package Microsoft.ML -Version 1.5.5
when i run this line of code:

InferenceSession session = new InferenceSession(modelPath);
I receive this error:

System.TypeInitializationException: 'The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.'

EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.


public SessionOptions()
: base(IntPtr.Zero, true)
NativeApiStatus.VerifySuccess(NativeMethods.OrtCreateSessionOptions(out handle));

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,640 questions
.NET Machine learning
.NET Machine learning
.NET: Microsoft Technologies based on the .NET software framework.Machine learning: A type of artificial intelligence focused on enabling computers to use observed data to evolve new behaviors that have not been explicitly programmed.
154 questions
0 comments No comments
{count} votes