WI

windows-ml-project-setup

Automates the configuration of .NET/WinUI 3 projects for Windows ML, ensuring correct package versions and build settings.

Install

mkdir -p .claude/skills/windows-ml-project-setup && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17961" && unzip -o skill.zip -d .claude/skills/windows-ml-project-setup && rm skill.zip

Installs to .claude/skills/windows-ml-project-setup

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Set up a .NET/WinUI 3 project for Windows ML with correct NuGet packages, csproj settings, and native DLL deployment. Use when: creating a new Windows ML project, fixing build errors, DllNotFoundException for onnxruntime, self-contained deployment, unpackaged WinUI 3 app setup.
278 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Add required NuGet packages for Windows ML and ONNX Runtime.
  • Configure csproj settings for unpackaged WinUI 3 applications.
  • Deploy native DLLs for `Microsoft.WindowsAppSDK.ML`.
  • Address `DllNotFoundException` for `onnxruntime`.
  • Resolve `FileNotFoundException` for `System.Numerics.Tensors`.

How it works

The skill specifies required NuGet packages and csproj settings, and details how to manually deploy native DLLs that .NET does not auto-copy.

Inputs & outputs

You give it
A .NET/WinUI 3 project that uses Windows ML or ONNX Runtime.
You get back
A configured project with correct NuGet packages, csproj settings, and deployed native DLLs.

When to use windows-ml-project-setup

  • Create new Windows ML project
  • Resolve DllNotFoundException for onnxruntime
  • Fix build errors related to PRI and MSIX
  • Configure self-contained deployment for WinUI 3

About this skill

Windows ML Project Setup

When to Use

  • Creating a new C# project that uses Windows ML / ONNX Runtime
  • Getting build errors related to PRI generation, MSIX, or MRT
  • Getting DllNotFoundException for onnxruntime at runtime
  • Getting FileNotFoundException for System.Numerics.Tensors
  • Setting up self-contained or framework-dependent deployment

Required NuGet Packages

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
<PackageReference Include="Microsoft.WindowsAppSDK.ML" Version="1.8.2141" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4654" />
<PackageReference Include="System.Numerics.Tensors" Version="10.0.5" />

Important: System.Numerics.Tensors is NOT declared as a transitive dependency by the ML package. You must add it explicitly or you'll get a runtime crash: Could not load file or assembly 'System.Numerics.Tensors, Version=9.0.0.0'.

Required csproj Settings for Unpackaged Apps

<PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
    <UseWinUI>true</UseWinUI>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <WindowsPackageType>None</WindowsPackageType>
    <EnableMsixTooling>false</EnableMsixTooling>
    <GeneratePriFile>false</GeneratePriFile>
    <DisableMrtCodeGen>true</DisableMrtCodeGen>
    <EnableCoreMrtTooling>false</EnableCoreMrtTooling>
</PropertyGroup>

Native DLL Deployment (Critical)

The Microsoft.WindowsAppSDK.ML NuGet package stores native DLLs in a non-standard path (runtimes-framework\win-x64\native\) that .NET doesn't auto-copy. You MUST add these manually:

<ItemGroup>
    <Content Include="$(NuGetPackageRoot)microsoft.windowsappsdk.ml\1.8.2141\runtimes-framework\win-x64\native\onnxruntime.dll"
             CopyToOutputDirectory="PreserveNewest" Link="onnxruntime.dll" />
    <Content Include="$(NuGetPackageRoot)microsoft.windowsappsdk.ml\1.8.2141\runtimes-framework\win-x64\native\onnxruntime_providers_shared.dll"
             CopyToOutputDirectory="PreserveNewest" Link="onnxruntime_providers_shared.dll" />
    <Content Include="$(NuGetPackageRoot)microsoft.windowsappsdk.ml\1.8.2141\runtimes-framework\win-x64\native\DirectML.dll"
             CopyToOutputDirectory="PreserveNewest" Link="DirectML.dll" />
    <Content Include="$(NuGetPackageRoot)microsoft.windowsappsdk.ml\1.8.2141\runtimes-framework\win-x64\native\Microsoft.Windows.AI.MachineLearning.dll"
             CopyToOutputDirectory="PreserveNewest" Link="Microsoft.Windows.AI.MachineLearning.dll" />
</ItemGroup>

For ARM64, replace win-x64 with win-arm64.

XAML Theme Warning

In unpackaged apps without the full VS toolchain, XamlControlsResources in App.xaml can cause crashes. Use empty resources:

<Application.Resources>
    <ResourceDictionary />
</Application.Resources>

Build Command

dotnet build MyProject.csproj -c Debug -p:Platform=x64

When not to use it

  • When the project does not use Windows ML or ONNX Runtime.
  • When the project is not a .NET/WinUI 3 application.
  • When not creating a new project or fixing related build errors.

Limitations

  • The skill focuses on .NET/WinUI 3 projects.
  • The skill addresses specific `DllNotFoundException` and `FileNotFoundException` errors.
  • The skill provides configurations for unpackaged apps.

How it compares

This skill provides specific configurations and deployment steps for Windows ML projects, unlike general .NET project setup.

Compared to similar skills

windows-ml-project-setup side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
windows-ml-project-setup (this skill)04moNo flagsIntermediate
azure-resource-manager-mysql-dotnet12moReviewIntermediate
deployment-e2e-testing32moReviewAdvanced
azure-ai-openai-dotnet12moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

azure-resource-manager-mysql-dotnet

microsoft

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "MySQL", "MySqlFlexibleServer", "MySQL Flexible Server", "Azure Database for MySQL", "MySQL database management", "MySQL firewall", "MySQL backup".

14

deployment-e2e-testing

dotnet

Guide for writing Aspire deployment end-to-end tests. Use this when asked to create, modify, or debug deployment E2E tests that deploy to Azure.

32

azure-ai-openai-dotnet

microsoft

Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: "Azure OpenAI", "AzureOpenAIClient", "ChatClient", "chat completions .NET", "GPT-4", "embeddings", "DALL-E", "Whisper", "OpenAI .NET".

13

azure-ai-document-intelligence-dotnet

microsoft

Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: "Document Intelligence", "DocumentIntelligenceClient", "form recognizer", "invoice extraction", "receipt OCR", "document analysis .NET".

03

azure-mgmt-weightsandbiases-dotnet

microsoft

Azure Weights & Biases SDK for .NET. ML experiment tracking and model management via Azure Marketplace. Use for creating W&B instances, managing SSO, marketplace integration, and ML observability. Triggers: "Weights and Biases", "W&B", "WeightsAndBiases", "ML experiment tracking", "model registry", "experiment management", "wandb".

11

ms-agent-framework-rag

shuyu-labs

Comprehensive guide for building Agentic RAG systems using Microsoft Agent Framework in C#. Use when creating RAG applications with semantic search, document indexing, and intelligent agent orchestration. Includes scaffolding scripts, reference implementations, and documentation for vector databases, embedding models, and multi-agent workflows.

10

Search skills

Search the agent skills registry