Power Toys compilation error: This project references NuGet package(s) that are missing

Viewed 34

I'm trying to fork Microsoft Power Toys and make some changes in my local copy. However, I'm encountering build errors that prevent it from compiling.

Steps I've taken:

  1. Installed fresh copy of Microsoft Visual Studio 2022
  2. File -> Clone Repository -> https://github.com/microsoft/PowerToys
  3. a message pops up which says "Visual Studio has detected a CMakeLists.txt file in one or more subdirectories of the open workspace. Do you want to enable Visual Studio's CMake support with this workspace?" Despite what it says I can't find any such CMakeLists.txt in the project repository so I click "Do not enable"
  4. I attempt to build the project and get the following error:

1>------ Build started: Project: logging, Configuration: Debug|x64 ------ 2>------ Build started: Project: Display, Configuration: Debug|x64 ------ 3>------ Build started: Project: SettingsAPI, Configuration: Debug|x64 ------ 4>------ Build started: Project: Themes, Configuration: Debug|x64 ------ 1> spdlog.cpp 1> stdout_sinks.cpp 1> color_sinks.cpp 1> file_sinks.cpp 3>C:\Users\Admin\Source\Repos\PowerToys2\src\common\SettingsAPI\SettingsAPI.vcxproj(53,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.CppWinRT.2.0.220418.1\build\native\Microsoft.Windows.CppWinRT.props. 2> monitors.cpp 2> dpi_aware.cpp 4>C:\Users\Admin\Source\Repos\PowerToys2\src\common\Themes\Themes.vcxproj(55,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.CppWinRT.2.0.220418.1\build\native\Microsoft.Windows.CppWinRT.props. 1> async.cpp 1> cfg.cpp 1> fmt.cpp 2> Display.vcxproj -> C:\Users\Admin\Source\Repos\PowerToys2\x64\Debug\Display.lib 1> logging.vcxproj -> C:\Users\Admin\Source\Repos\PowerToys2\x64\Debug\spdlog.lib 5>------ Build started: Project: logger, Configuration: Debug|x64 ------ 5>C:\Users\Admin\Source\Repos\PowerToys2\src\common\logger\logger.vcxproj(89,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.CppWinRT.2.0.220418.1\build\native\Microsoft.Windows.CppWinRT.props. 6>------ Build started: Project: ShortcutGuide, Configuration: Debug|x64 ------ 6> 6> 6> Directory: C:\Users\Admin\Source\Repos\PowerToys2\src\modules\ShortcutGuide\ShortcutGuide 6> 6> 6> Mode LastWriteTime Length Name
6> ---- ------------- ------ ----
6> d----- 9/18/2022 5:03 PM Generated Files 6> Processing C:\Users\Admin\Source\Repos\PowerToys2\src\modules\ShortcutGuide\ShortcutGuide\Resources.resx 6> 6>
6>C:\Users\Admin\Source\Repos\PowerToys2\src\modules\ShortcutGuide\ShortcutGuide\ShortcutGuide.vcxproj(189,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.CppWinRT.2.0.220418.1\build\native\Microsoft.Windows.CppWinRT.props. ========== Build: 2 succeeded, 4 failed, 0 up-to-date, 0 skipped ========== Build failed.

You can change this setting at any time in Project > CMake Workspace Settings.

I tried this on two seperate computers with a fresh copy of Visual Studio 2022. File -> Clone Repository -> https://github.com/microsoft/PowerToys

My question is how can I resolve this compilation error? Thank-you.

0 Answers
Related