Description
Hello,
I am encountering an issue with my .NET 7.0 project using ONNX Runtime. Despite having Microsoft.ML.OnnxRuntime.dll in my project, the application fails with an error indicating that onnxruntime.dll cannot be found.
Here are the steps I followed:
I ensured onnxruntime.dll is located in bin\Debug\net7.0\runtimes\win-x64\native.
I manually copied onnxruntime.dll to bin\Debug\net7.0, but the issue persists.
I updated my .csproj file with the following configuration to copy the DLL automatically:
<ItemGroup> <None Update="runtimes\win-x64\native\onnxruntime.dll"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup>
The application crashes at the following line without throwing an error:
NativeApiStatus.VerifySuccess(NativeMethods.OrtCreateSessionOptions(out handle));
However, the problem remains unsolved. I would appreciate any guidance on resolving this issue.
Environment:
.NET 7.0
Microsoft.ML.OnnxRuntime version [1.18.1]
Windows [11]
Thank you!