onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.Tests.MAUI/ReadMe.md
Scott McKay ba0bb43b00
Rework the native library usage so that a pre-built ORT native package can be easily used (#22345)
### Description
The local build of the native library was being included by almost every
project, but is only needed to run tests. Due to the multiple inclusions
attempting to use a pre-built package was clashing with any local builds
that were available.

Create a helper file to include either a local built of a pre-built
package and include that in the two test projects.

Cleanup various miscellaous things.

### Motivation and Context

Create setup to simplify running on-device tests with the nuget
packages.
2024-11-01 11:03:33 -07:00

622 B

The MAUI test project can be optionally used with a pre-built ONNX Runtime native nuget package (Microsoft.ML.OnnxRuntime).

To do so, specify the UsePrebuiltNativePackage and CurrentOnnxRuntimeVersion properties when building the project. These can be set via the command-line or as environment variables.

For example:

dotnet build csharp\test\Microsoft.ML.OnnxRuntime.Tests.MAUI\Microsoft.ML.OnnxRuntime.Tests.MAUI.csproj --property:UsePrebuiltNativePackage=true --property:CurrentOnnxRuntimeVersion=1.19.2 --source directory_containing_native_nuget_package --source https://api.nuget.org/v3/index.json