-1

I am using ML.NET services

I've created and trained an ONNX model, created a library to working with a trained model. But there is a problem

Any application that uses the library I created requires the Microsoft.ML.OnnxRuntime nuget package to be installed.

My library needs to be used in a deployed 3rd party application where installing nuget packages is not allowed, but it is possible to add DLLs. In addition to dll libraries, nothing can be added, config files cannot be added too.

I've tried adding dlls which are installed by Microsoft.ML.OnnxRuntime nuget package:

  • Microsoft.ML.OnnxRuntime;
  • System.Buffers;
  • System.Memory;
  • System.Numerics;
  • System.Numerics.Vectors;
  • System.Runtime.CompilerServices.Unsafe.

But I didn't get the right result. Instantiating a class from my library causes an exception:

'The type initializer for' Microsoft.ML.OnnxRuntime.NativeMethods 'threw an exception.' EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.

Is it possible to fix the problem without installing the Microsoft.ML.OnnxRuntime nuget package into the application to use my library?

Semen
  • 1
  • 1

1 Answers1

0

Problem is that the Microsoft.ML.OnnxRuntime library is loading the native onnxruntime.dll.

Therefore, in addition to installing the reference for the above libraries, it is necessary to copy the onnxruntime.dll library to the application folder.

onnxruntime.dll be taken from the nuget package

Semen
  • 1
  • 1