From 9aca6d136f7f9c301203905f3edf9a6f12cc8afe Mon Sep 17 00:00:00 2001
From: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
Date: Tue, 16 Dec 2025 10:46:39 +0800
Subject: [PATCH] Revert "Revert commit" - Using centralized package management
for vcxproj (#44289)
Reverts microsoft/PowerToys#44208
Basically enable back: https://github.com/microsoft/PowerToys/pull/43920
the core change is adding this new Target to ensure when "building in
Visual Studio", it will restore the nuget package first for vcxproj:
```xml
```
---
Cpp.Build.props | 11 ++-
Directory.Build.targets | 16 ++++
Directory.Packages.props | 11 ++-
.../PowerToys.MeasureToolCore.vcxproj | 68 ++++-----------
.../MeasureToolCore/packages.config | 17 ----
.../MeasureToolUI/MeasureToolUI.csproj | 9 +-
.../FindMyMouse/FindMyMouse.vcxproj | 82 ++++++-------------
.../MouseUtils/FindMyMouse/packages.config | 12 ---
src/modules/cmdpal/CoreCommonProps.props | 6 +-
.../Microsoft.CmdPal.UI/CmdPal.Branding.props | 14 ++--
.../Microsoft.CmdPal.UI/CmdPal.pre.props | 2 +-
.../Microsoft.CmdPal.UI.csproj | 27 +++---
.../FontIconGlyphClassifier.cpp | 6 +-
.../Microsoft.Terminal.UI.vcxproj | 72 +++++-----------
.../Microsoft.Terminal.UI/packages.config | 17 ----
.../PowerRenameUILib/PowerRenameUI.vcxproj | 82 +++++--------------
src/runner/packages.config | 16 ----
src/runner/runner.vcxproj | 76 ++++++-----------
src/runner/runner.vcxproj.filters | 1 -
19 files changed, 179 insertions(+), 366 deletions(-)
delete mode 100644 src/modules/MeasureTool/MeasureToolCore/packages.config
delete mode 100644 src/modules/MouseUtils/FindMyMouse/packages.config
delete mode 100644 src/modules/cmdpal/Microsoft.Terminal.UI/packages.config
delete mode 100644 src/runner/packages.config
diff --git a/Cpp.Build.props b/Cpp.Build.props
index f146a4d770..7b988f0d6f 100644
--- a/Cpp.Build.props
+++ b/Cpp.Build.props
@@ -42,6 +42,11 @@
+
+ true
+ TurnOffAllWarnings
+ true
+
true
Use
pch.h
@@ -111,13 +116,11 @@
-
+
true
true
-
+
false
true
false
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 6da66bc8a8..f815cfbb3f 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -8,4 +8,20 @@
$(WindowsSdkDir)bin\x64\mt.exe
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 60567e30b8..eb04903b7e 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -7,6 +7,8 @@
+
+
@@ -70,10 +72,12 @@
This is present due to a bug in CsWinRT where WPF projects cause the analyzer to fail.
-->
+
-
-
-
+
+
+
+
@@ -112,6 +116,7 @@
+
diff --git a/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj b/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj
index 6de7c50b55..c71c81acec 100644
--- a/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj
+++ b/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj
@@ -1,14 +1,16 @@
-
-
-
-
-
-
-
-
-
+
+
+ PackageReference
+
+
+ native,Version=v0.0
+
+
+ Windows
+ $(WindowsTargetPlatformVersion)
+
true
true
@@ -31,6 +33,11 @@
true
true
+
+
+
+
+
DynamicLibrary
@@ -38,7 +45,6 @@
true
-
@@ -118,9 +124,6 @@
true
-
-
-
{caba8dfb-823b-4bf2-93ac-3f31984150d9}
@@ -142,42 +145,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/src/modules/MeasureTool/MeasureToolCore/packages.config b/src/modules/MeasureTool/MeasureToolCore/packages.config
deleted file mode 100644
index 6416ca5b16..0000000000
--- a/src/modules/MeasureTool/MeasureToolCore/packages.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/MeasureTool/MeasureToolUI/MeasureToolUI.csproj b/src/modules/MeasureTool/MeasureToolUI/MeasureToolUI.csproj
index 434ff088b2..3e92bd42f3 100644
--- a/src/modules/MeasureTool/MeasureToolUI/MeasureToolUI.csproj
+++ b/src/modules/MeasureTool/MeasureToolUI/MeasureToolUI.csproj
@@ -73,6 +73,13 @@
-
+
+ false
+ true
+
+
+
+ PreserveNewest
+
diff --git a/src/modules/MouseUtils/FindMyMouse/FindMyMouse.vcxproj b/src/modules/MouseUtils/FindMyMouse/FindMyMouse.vcxproj
index d127de245e..bfed4af15d 100644
--- a/src/modules/MouseUtils/FindMyMouse/FindMyMouse.vcxproj
+++ b/src/modules/MouseUtils/FindMyMouse/FindMyMouse.vcxproj
@@ -1,13 +1,16 @@
-
-
-
-
-
-
-
-
+
+
+ PackageReference
+
+
+ native,Version=v0.0
+
+
+ Windows
+ $(WindowsTargetPlatformVersion)
+
15.0
{e94fd11c-0591-456f-899f-efc0ca548336}
@@ -20,9 +23,12 @@
false
true
false
-
- packages.config
+
+
+
+
+
DynamicLibrary
@@ -127,18 +133,18 @@
-
-
-
-
-
-
-
-
- NotUsing
-
-
+
+
+
+
+
+
+
+ NotUsing
+
+
+
<_ToDelete Include="$(OutDir)Microsoft.Web.WebView2.Core.dll" />
@@ -148,38 +154,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/MouseUtils/FindMyMouse/packages.config b/src/modules/MouseUtils/FindMyMouse/packages.config
deleted file mode 100644
index cff3aa8705..0000000000
--- a/src/modules/MouseUtils/FindMyMouse/packages.config
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/modules/cmdpal/CoreCommonProps.props b/src/modules/cmdpal/CoreCommonProps.props
index aa091d435e..438d044e2a 100644
--- a/src/modules/cmdpal/CoreCommonProps.props
+++ b/src/modules/cmdpal/CoreCommonProps.props
@@ -6,12 +6,12 @@
preview
- $(SolutionDir)$(Platform)\$(Configuration)\WinUI3Apps\CmdPal\
+ ..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\CmdPal\
false
false
$(RootNamespace).pri
-
+
SA1313;
@@ -42,5 +42,5 @@
Resources.Designer.cs
-
+
diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.Branding.props b/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.Branding.props
index d99688c081..298bcbd787 100644
--- a/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.Branding.props
+++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.Branding.props
@@ -24,7 +24,7 @@
-
+
true
Assets\%(RecursiveDir)%(FileName)%(Extension)
@@ -35,14 +35,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.pre.props b/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.pre.props
index 21c2e7d8d1..d65b4a2cc2 100644
--- a/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.pre.props
+++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.pre.props
@@ -7,7 +7,7 @@
- $(SolutionDir)$(Platform)\$(Configuration)\WinUI3Apps\CmdPal
+ ..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\CmdPal
$(OutputPath)\AppPackages\
diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj b/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj
index 7a413d316c..54961a5828 100644
--- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj
+++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj
@@ -15,7 +15,7 @@
enable
enable
true
- preview
+ preview
$(CmdPalVersion)
@@ -23,13 +23,14 @@
false
false
+ true
-
+
-
+ -->
true
@@ -45,7 +46,7 @@
-
+
Microsoft.Terminal.UI;CmdPalKeyboardService
$(OutDir)
@@ -101,7 +102,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers
@@ -147,12 +148,16 @@
-
- True
- True
- True
+
+ False
+ True
-
+
+
+
+
+ PreserveNewest
+
True
True
diff --git a/src/modules/cmdpal/Microsoft.Terminal.UI/FontIconGlyphClassifier.cpp b/src/modules/cmdpal/Microsoft.Terminal.UI/FontIconGlyphClassifier.cpp
index bc3496a542..e6cb46457b 100644
--- a/src/modules/cmdpal/Microsoft.Terminal.UI/FontIconGlyphClassifier.cpp
+++ b/src/modules/cmdpal/Microsoft.Terminal.UI/FontIconGlyphClassifier.cpp
@@ -12,9 +12,9 @@ namespace winrt::Microsoft::Terminal::UI::implementation
// Check if the code point is in the Private Use Area range used by Fluent UI icons.
[[nodiscard]] constexpr bool _isFluentIconPua(const UChar32 cp) noexcept
{
- static constexpr UChar32 _fluentIconsPrivateUseAreaStart = 0xE700;
- static constexpr UChar32 _fluentIconsPrivateUseAreaEnd = 0xF8FF;
- return cp >= _fluentIconsPrivateUseAreaStart && cp <= _fluentIconsPrivateUseAreaEnd;
+ constexpr UChar32 fluentIconsPrivateUseAreaStart = 0xE700;
+ constexpr UChar32 fluentIconsPrivateUseAreaEnd = 0xF8FF;
+ return cp >= fluentIconsPrivateUseAreaStart && cp <= fluentIconsPrivateUseAreaEnd;
}
// Determine if the given text (as a sequence of UChar code units) is emoji
diff --git a/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj b/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj
index 6e474cf5f3..676d7297ba 100644
--- a/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj
+++ b/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj
@@ -1,17 +1,16 @@
-
-
- ..\..\..\..\
- $(PathToRoot)packages\Microsoft.WindowsAppSDK.1.8.250907003
+
+
+ PackageReference
+
+ native,Version=v0.0
+
+ Windows
+ $(WindowsTargetPlatformVersion)
+
+
-
-
-
-
-
-
-
true
true
@@ -28,6 +27,11 @@
10.0.26100.0
10.0.19041.0
+
+
+
+
+
@@ -47,10 +51,6 @@
x64
-
- $(SolutionDir)$(Platform)\$(Configuration)\WinUI3Apps\CmdPal
- obj\$(Platform)\$(Configuration)\
-
DynamicLibrary
v143
@@ -200,43 +200,11 @@
-
+
+ ..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\CmdPal
+ obj\$(Platform)\$(Configuration)\
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/src/modules/cmdpal/Microsoft.Terminal.UI/packages.config b/src/modules/cmdpal/Microsoft.Terminal.UI/packages.config
deleted file mode 100644
index 2fb34c8fed..0000000000
--- a/src/modules/cmdpal/Microsoft.Terminal.UI/packages.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj b/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj
index eb21a94049..de71eb2188 100644
--- a/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj
+++ b/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj
@@ -1,18 +1,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ PackageReference
+
+
+ native,Version=v0.0
+
+
+ Windows
+ $(WindowsTargetPlatformVersion)
+
true
true
@@ -37,9 +35,17 @@
true
PowerToys.PowerRename.pri
+ win10-x64;win10-arm64
+ false
+
+
+
+
+
+
+
-
Application
v143
@@ -212,54 +218,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
\ No newline at end of file
+
diff --git a/src/runner/packages.config b/src/runner/packages.config
deleted file mode 100644
index 74d5ef5747..0000000000
--- a/src/runner/packages.config
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/runner/runner.vcxproj b/src/runner/runner.vcxproj
index c8cf2f2106..57cb55b6bd 100644
--- a/src/runner/runner.vcxproj
+++ b/src/runner/runner.vcxproj
@@ -1,27 +1,34 @@
-
+
81010002
+
+
+ PackageReference
+
+ native,Version=v0.0
+
+ Windows
+ $(WindowsTargetPlatformVersion)
+
15.0
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}
powertoys
runner
+
+
+
+
+
+
-
-
-
-
-
-
-
-
Application
@@ -31,10 +38,6 @@
true
-
-
-
-
@@ -130,9 +133,6 @@
{17da04df-e393-4397-9cf0-84dabe11032e}
-
-
-
@@ -141,39 +141,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 {0}.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ NotUsing
+
+
\ No newline at end of file
diff --git a/src/runner/runner.vcxproj.filters b/src/runner/runner.vcxproj.filters
index d55e53048e..904e213405 100644
--- a/src/runner/runner.vcxproj.filters
+++ b/src/runner/runner.vcxproj.filters
@@ -118,7 +118,6 @@
-