We are using the latest nuget package for Aspose.OCR - 25.6.0 - in a solution targeting .NET Framework 4.8 and it’s working fine with Microsoft.ML.OnnxRuntime packages version 1.22.0
Microsoft released a new version of this nuget package - Microsoft.ML.OnnxRuntime and Microsoft.ML.OnnxRuntime.Managed 1.22.1 but when I install this into the Solution I get warnings when building the software
Found conflicts between different versions of “Microsoft.ML.OnnxRuntime” that could not be resolved.
There was a conflict between “Microsoft.ML.OnnxRuntime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6” and “Microsoft.ML.OnnxRuntime, Version=1.22.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6”.
“Microsoft.ML.OnnxRuntime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6” was chosen because it was primary and “Microsoft.ML.OnnxRuntime, Version=1.22.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6” was not.
References which depend on “Microsoft.ML.OnnxRuntime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6” [….nuget\packages\microsoft.ml.onnxruntime.managed\1.22.1\lib\netstandard2.0\Microsoft.ML.OnnxRuntime.dll].
….nuget\packages\microsoft.ml.onnxruntime.managed\1.22.1\lib\netstandard2.0\Microsoft.ML.OnnxRuntime.dll
Project file item includes which caused reference “….nuget\packages\microsoft.ml.onnxruntime.managed\1.22.1\lib\netstandard2.0\Microsoft.ML.OnnxRuntime.dll”.
….nuget\packages\microsoft.ml.onnxruntime.managed\1.22.1\lib\netstandard2.0\Microsoft.ML.OnnxRuntime.dll
References which depend on or have been unified to “Microsoft.ML.OnnxRuntime, Version=1.22.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6” [].
….nuget\packages\aspose.ocr\25.6.0\lib\netstandard2.0\Aspose.OCR.dll
Project file item includes which caused reference “….nuget\packages\aspose.ocr\25.6.0\lib\netstandard2.0\Aspose.OCR.dll”.
….nuget\packages\aspose.ocr\25.6.0\lib\netstandard2.0\Aspose.OCR.dll
Is this an issue with the Microsoft.ML.OnnxRuntime packages or Aspose.OCR?
For the moment I can revert back to Microsoft.ML.OnnxRuntime packages versions 1.22.0 but of course I would like to be able to keep our nuget references up to date.
The warnings you’re encountering are due to version conflicts between the Microsoft.ML.OnnxRuntime packages. Specifically, your project is trying to reference both version 1.22.0 and version 1.22.1 of the Microsoft.ML.OnnxRuntime library, which leads to the build issues.
Solution
To resolve this conflict, follow these steps:
Check Dependencies: Ensure that all your project dependencies are compatible with Microsoft.ML.OnnxRuntime version 1.22.1. Update any other packages that depend on Microsoft.ML.OnnxRuntime to their latest versions.
Clear NuGet Cache: Clearing the NuGet cache can help resolve version conflicts. Run the following command in the Package Manager Console:
dotnet nuget locals all --clear
Explicit Versioning: In your project file (e.g., .csproj), explicitly specify the version of Microsoft.ML.OnnxRuntime you want to use. Ensure all references align with this version.
Reinstall Packages: After making the above changes, reinstall the packages using:
After making these adjustments, rebuild your solution. If you still encounter issues, consider temporarily reverting to version 1.22.0 while checking for updates or compatibility notes from the package maintainers.
Please implement these steps and let me know if you need further assistance!
We would like to inform you that the latest version of ONNX Runtime is not fully supported in Aspose.OCR for .NET when using the .NET Framework. Earlier we only included 1.20.1 version and later we updated it to 1.22.0 in the latest releases. Therefore, you need to downgrade the onnxruntime version to receive expected results from the API. In case you need further information, please let us know.
Are the dependencies on Onnx going to be removed from future versions of Aspose.OCR? Or should I revert to Microsoft and ask them to address the problem at their end?
We don’t intend to resolve these kind of dependencies in future. We will collect further information against it and will get back to you with feedback.
Hm. Okay … but don’t forget that people may be creating Solutions that target other packages as well as Aspose. In the case of Onnx ML, at least for us, we only have to include it because Aspose.OCR has dependencies to it so it wouldn’t be too big a deal to leave it on 1.22.0 - but if someone else writes code that depends on it, and they need to upgrade it to a newer version because of some improvement or other in Onnx ML, they should be able to do so without breaking their Solution, surely?
Likewise, we are stuck with .NET Framework 4.8 because of some of the functionality we need to be able to use. Just checking, is this only an issue because of .NET Framework 4.8? We have developed the OCR part of our solution to be independent of the rest of the solution - we call it through an executable rather than a DLL - so if that’s the case we could migrate at least THAT code to .NET Core or whatnot.
We will update the version of onnxruntime in each release to stay up to date with the Microsoft’s releases, except then they release a version that is not compatible with something in our library (there have been such cases). Nevertheless, your concerns have been noted down and we will share more information with you against them. Please give us little time.
Thank you, that is perfect, we are not in a “mad rush” to have this addressed so please take all the time you need.
I hope you’ll get some joy from Microsoft. They haven’t been exactly “stellar” keeping their new nuget releases backward compatible I’ve noticed in recent months.
Keep upgrading the onnxruntime version is not a big task unless it remains compatible with our API and previous versions. If its not, sadly we have to stick up to the version that is compatible. Furthermore, can you please clarify on below?
What kind of issues have you faced in .NET? Do you mean you have some other functionality which needs to be in .NET Framework 4.8? Is it about Aspose.OCR? Are you asking if Aspose.OCR has dependency upon onnxruntime in .NET Core?
Yes, our software comprises of a Solution with nearly 90 projects in it, creating executables, DLLs etc. Some of them are kind of old and rely on 3rd party components that we can only get to work in .NET Framework 4.8
The project that uses Aspose.OCR, however, is actually a standalone executable, so if Aspose.OCR for .NET Core or .NET 9 or whatnot can keep all its dependencies up to date it may be a good idea for me to just rebuild it against that target. That would be fine if it can keep using the most recent onnxruntime or if it can be built without explicitly including onnxruntime nuget packages.
We will definitely try our best to keep the latest version of the dependency as long as it is backward compatible and creates no issue with Aspose.OCR. Furthermore, we will surely inform you in case we have some more updates to share in this regard.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.