Skip to main content

Microsoft Windows AI Machine Learning APIs. This package provides the Windows ML runtime, ONNX Runtime integration, and DirectML support for Windows desktop applications. Includes ONNX Runtime 1.27.1. Minimum OS: Windows 10 19H1 (Build 18362) or later. For support down to 17763, install Microsoft.WindowsAppSDK.ML.

Total Downloads
1.7M
1,675,826
Published
Sep 22, 2026
1mo ago

Get Started

dotnet add package Microsoft.Windows.AI.MachineLearning --version 2.4.89
ProductVersions
.NET
net8.0-windows10.0.17763

README

Using Microsoft.Windows.AI.MachineLearning

The Microsoft.Windows.AI.MachineLearning package provides Windows Machine Learning APIs for on-device AI inference using ONNX Runtime.

This package includes ONNX Runtime 1.27.1.

Requirements

  • Minimum OS: Windows 10 19H1 (build 18362) or later.
  • For Windows 10 versions prior to 19H1 (build 18362), use the Microsoft.WindowsAppSDK.ML package instead, which provides framework-based deployment via the Windows App SDK runtime.

Getting Started

Add a reference to Microsoft.Windows.AI.MachineLearning in your project. No additional configuration is required for unpackaged apps on Windows 10 19H1+ and Windows 11.

Native C++

#include <winrt/Microsoft.Windows.AI.MachineLearning.h>

.NET

using Microsoft.Windows.AI.MachineLearning;

Deployment

Binaries are deployed alongside your application:

MyApp/
├── MyApp.exe
├── Microsoft.Windows.AI.MachineLearning.dll
├── onnxruntime.dll
└── DirectML.dll

WinRT activation relies on OS-native reg-free WinRT, available on Windows 10 19H1+.

Using ONNX Runtime Headers

The ONNX Runtime headers are included in a winml subdirectory:

#include <winml/onnxruntime_c_api.h>
#include <winml/onnxruntime_cxx_api.h>

To use headers without the winml/ prefix:

<PropertyGroup>
  <WinMLEnableDefaultOrtHeaderIncludePath>true</WinMLEnableDefaultOrtHeaderIncludePath>
</PropertyGroup>

WindowsAppSDK Integration

For WindowsAppSDK consumers or packaged (MSIX) applications, use Microsoft.WindowsAppSDK.ML instead. It depends on this package transitively and provides additional integration with the Windows App SDK runtime.

More Information

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.