You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/new-windows-ml/distributing-your-app.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,21 @@
1
1
---
2
2
title: Deploy your app that uses Windows ML
3
3
description: Learn how to deploy your app that uses Windows Machine Learning (ML).
4
-
ms.date: 07/07/2025
4
+
ms.date: 03/10/2026
5
5
ms.topic: concept-article
6
6
---
7
7
8
8
# Deploy your app that uses Windows ML
9
9
10
-
When you're ready to distribute your C# or C++ app that uses Windows ML, you need to ensure that the Windows App SDK framework is properly deployed to your users' devices. The Windows ML runtime is distributed as part of the Windows App SDK.
10
+
Windows ML is deployed like any other Windows App SDK component, supporting both framework-dependent and self-contained deployment. See the [Windows App SDK deployment overview](/windows/apps/package-and-deploy/deploy-overview) for more details about the deployment options in Windows App SDK.
11
11
12
-
## Supported deployment options for Windows ML
13
-
14
-
Windows ML supports both the framework-dependent and the self-contained deployment options in Windows App SDK. See the [Windows App SDK deployment overview](/windows/apps/package-and-deploy/deploy-overview) for more details about the deployment options in Windows App SDK.
15
-
16
-
### Framework-dependent: ✅ Supported
12
+
## Framework-dependent
17
13
18
14
Your app depends on the Windows App SDK runtime and/or framework package being present on the target machine. Framework-dependent deployment is the default deployment mode of the Windows App SDK for its efficient use of machine resources and serviceability. See [Deployment architecture and overview for framework-dependent apps](/windows/apps/windows-app-sdk/deployment-architecture) for more details.
19
15
20
-
###Self-contained: ✅ Supported
16
+
## Self-contained
21
17
22
-
With the GA release of Windows ML, use of the self-contained deployment option in Windows App SDK is now supported when using Windows ML. See [Deployment guide for self-contained apps](/windows/apps/package-and-deploy/self-contained-deploy/deploy-self-contained-apps) for more details.
18
+
Your app carries the Windows App SDK dependencies with it. See [Deployment guide for self-contained apps](/windows/apps/package-and-deploy/self-contained-deploy/deploy-self-contained-apps) for more details.
23
19
24
20
In self-contained mode, ONNX Runtime binaries are deployed alongside your application:
Copy file name to clipboardExpand all lines: docs/new-windows-ml/get-started.md
+119-8Lines changed: 119 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,28 +21,90 @@ If you're not already familiar with the ONNX Runtime, we suggest reading the [ON
21
21
* .NET 6 or greater
22
22
* Targeting a Windows 10-specific TFM like `net6.0-windows10.0.19041.0` or greater
23
23
24
-
### [C++](#tab/cppwinrt)
24
+
### [C++/WinRT](#tab/cppwinrt)
25
25
26
26
C++20 or later.
27
27
28
+
### [C/C++](#tab/c)
29
+
30
+
* Visual Studio 2022 with C++ workload (includes the C compiler)
31
+
* CMake 3.21 or later
32
+
28
33
### [Python](#tab/python)
29
34
30
35
Python versions 3.10 to 3.13, on x64 and ARM64 devices.
31
36
32
37
---
33
38
34
-
## Step 1: Install or update the Windows App SDK
35
-
36
-
Windows ML is included in [Windows App SDK 1.8.1 or greater](/windows/apps/windows-app-sdk/stable-channel).
39
+
## Step 1: Install or update Windows ML
37
40
38
41
### [C#](#tab/csharp)
39
42
43
+
Windows ML is included in [Windows App SDK 1.8.1 or greater](/windows/apps/windows-app-sdk/stable-channel).
44
+
40
45
See [use the Windows App SDK in an existing project](/windows/apps/windows-app-sdk/use-windows-app-sdk-in-existing-project) for how to add the Windows App SDK to your project, or if you're already using Windows App SDK, update your packages.
41
46
42
-
### [C++](#tab/cppwinrt)
47
+
### [C++/WinRT](#tab/cppwinrt)
48
+
49
+
Windows ML is included in [Windows App SDK 1.8.1 or greater](/windows/apps/windows-app-sdk/stable-channel).
43
50
44
51
See [use the Windows App SDK in an existing project](/windows/apps/windows-app-sdk/use-windows-app-sdk-in-existing-project) for how to add the Windows App SDK to your project, or if you're already using Windows App SDK, update your packages.
45
52
53
+
### [C/C++](#tab/c)
54
+
55
+
Windows ML C APIs are included in the [`Microsoft.WindowsAppSDK.ML` NuGet package](https://www.nuget.org/packages/Microsoft.WindowsAppSDK.ML) version 1.8.6 or greater. The NuGet package ships CMake config files under `build/cmake/` that are directly consumable. The `@WINML_VERSION@` token is resolved at NuGet build time, so no additional processing is required.
56
+
57
+
To use the NuGet package...
58
+
59
+
1. Download or restore the NuGet package (e.g., via `nuget restore` or manual download)
60
+
2. Extract or reference the package root directory
61
+
3. Set `CMAKE_PREFIX_PATH` to the `build/cmake` subdirectory of the package
62
+
63
+
**Example CMakeLists.txt**
64
+
65
+
```cmake
66
+
cmake_minimum_required(VERSION 3.21)
67
+
project(MyApp LANGUAGES CXX)
68
+
69
+
# C++20 standard for modern features (std::format, etc.)
The NuGet package ships its own cmake config under `build/cmake/` that understands
95
+
the NuGet directory structure (architecture-specific directories under `lib/native/`
96
+
and `runtimes/`). Architecture is determined from `CMAKE_GENERATOR_PLATFORM`,
97
+
`CMAKE_VS_PLATFORM_NAME`, or `CMAKE_SYSTEM_PROCESSOR`.
98
+
99
+
The vcpkg portfile generates a separate, thin config file that maps to the standard
100
+
vcpkg layout (`lib/` and `bin/`). Both configs share the same targets file
101
+
(`microsoft.windows.ai.machinelearning-targets.cmake`) which defines the IMPORTED
102
+
targets.
103
+
104
+
The same targets (`WindowsML::WindowsML`, `WindowsML::Api`, `WindowsML::OnnxRuntime`, `WindowsML::DirectML`) are available
105
+
in both consumption modes. Use the standard CMake 3.21 `$<TARGET_RUNTIME_DLLS>` generator expression
106
+
to copy runtime DLLs to the build output directory.
107
+
46
108
### [Python](#tab/python)
47
109
48
110
The Python binding leverages the [pywinrt](https://github.com/pywinrt/pywinrt) project for the Windows App SDK projection. Ensure that your Python installation is not from the Microsoft Store (you can install an unpackaged version from python.org or via winget). The sample depends on using the Windows App SDK dynamic dependency API, which is only valid for unpackaged apps.
@@ -58,10 +120,10 @@ Please make sure the `wasdk-` packages' version matches the WindowsAppRuntime's
58
120
59
121
## Step 2: Download and register EPs
60
122
61
-
The simplest way to get started is to let Windows ML automatically discover, download, and register the latest version of all compatible execution providers. Execution providers need to be registered with the ONNX Runtime inside of Windows ML before you can use them. And if they haven't been downloaded yet, they need to be downloaded first. Calling `EnsureAndRegisterCertifiedAsync()` will do both of these in one step.
62
-
63
123
### [C#](#tab/csharp)
64
124
125
+
The simplest way to get started is to let Windows ML automatically discover, download, and register the latest version of all compatible execution providers. Execution providers need to be registered with the ONNX Runtime inside of Windows ML before you can use them. And if they haven't been downloaded yet, they need to be downloaded first. Calling `EnsureAndRegisterCertifiedAsync()` will do both of these in one step.
126
+
65
127
```csharp
66
128
usingMicrosoft.ML.OnnxRuntime;
67
129
usingMicrosoft.Windows.AI.MachineLearning;
@@ -84,7 +146,9 @@ var catalog = ExecutionProviderCatalog.GetDefault();
84
146
awaitcatalog.EnsureAndRegisterCertifiedAsync();
85
147
```
86
148
87
-
### [C++](#tab/cppwinrt)
149
+
### [C++/WinRT](#tab/cppwinrt)
150
+
151
+
The simplest way to get started is to let Windows ML automatically discover, download, and register the latest version of all compatible execution providers. Execution providers need to be registered with the ONNX Runtime inside of Windows ML before you can use them. And if they haven't been downloaded yet, they need to be downloaded first. Calling `EnsureAndRegisterCertifiedAsync()` will do both of these in one step.
0 commit comments