Can't Restore Nuget Packages in DirectML repo

28 Views Asked by At

I'm trying to get the "HelloDirectML" sample to work but I get an error stating that Nuget packages need to be restored. I've tried to use the console to restore and when you right click on the solution or project file in Visual Studio it doesn't have Restore Nuget menu option. So, I'm stuck not being able to run the sample.

So, how do you restore the nuget packages for this kind of project?

When I try to build the HelloDirectML solution in Visual Studio 2022 I get:

1>------ Build started: Project: HelloDirectML, Configuration: Debug|ARM ------ 1>E:\Repos\DirectML\Samples\HelloDirectML\HelloDirectML.vcxproj(445,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I tried the console restore and install of the packages

PM> NuGet\Install-Package Microsoft.Windows.ImplementationLibrary -Version 1.0.231028.1

Response:

NuGet\Install-Package : Project 'Default' is not found. At line:1 char:1

  • NuGet\Install-Package Microsoft.Windows.ImplementationLibrary -Versio ...
  •   + CategoryInfo          : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
      + FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
    
    

dotnet add package Microsoft.Windows.ImplementationLibrary --version 1.0.231028.1

Response:

Could not find any project in E:\Repos\DirectML\.

0

There are 0 best solutions below