Skip to content

Cannot install Microsoft.AI.Foundry.Local.WinML #640

@MikeYeager

Description

@MikeYeager

I have a Windows 11 ARM64 machine with VS 2026.

I created a console test application to try the .WinML version of FoundryLocal. At first, it told me it only supported TargetFramework net9.0-windows10.0.26100 (my target framework was net10.0). It kind of makes sense it would only work with a windows specific target. net10.0-windows10.0.26100 didn't work, but net9.0-windows10.0.26100 seemed to work after restarting VS.

Next it complained that my Platform was set to Any CPU, so I created an ARM64 profile.

When I try to install Microsoft.AI.Foundry.Local.WinML NuGet package, it eventually fails with a message "A NuGet restore loop has been detected in project ... Further restores have been aborted. The project might be in a bad state. Solution Explorer shows it tried to install Microsoft.ML.OnnxRuntime.Gpu.Linux, but failed.

I tried installing that package directly, which looked like it worked, but a build produced the following error: "Assets file 'D:\Dropbox\AI\FoundryLocalWinML\FoundryLocalWinML\obj\project.assets.json' doesn't have a target for 'net9.0-windows10.0.26100/win-arm64'. Ensure that restore has run and that you have included 'net9.0-windows10.0.26100' in the TargetFrameworks for your project. You may also need to include 'win-arm64' in your project's RuntimeIdentifiers."

Following that, I got a NUGET error on build: "The following PackageReference item(s) do not have a version specified: Microsoft.ML.OnnxRuntime.Gpu.Linux"

My .csproj file looks like this:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net9.0-windows10.0.26100</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <Platforms>ARM64</Platforms>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AI.Foundry.Local.WinML" Version="1.0.0" />
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.6" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.6" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Update="Microsoft.ML.OnnxRuntime.Gpu.Linux" Version="1.24.4" />
  </ItemGroup>

</Project>

Microsoft.AI.Foundry.Local package works fine, it's only the Microsoft.AI.Foundry.Local.WinML version I have issues with. I don't see a sample that addresses using this package.

I found a related issue that suggested adding a NuGet package source https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT/nuget/v3/index.json. and installing Microsoft.ML.OnnxRuntime.Foundry. That didn't fix the issue. What's the secret combination of things I need to use my NPU?

Thanks in advance,
Mike

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions