Ensure VS can build

This commit is contained in:
Gordon Lam (SH)
2025-12-15 17:41:31 +08:00
parent bb4feb8bd9
commit ff37a9343a
3 changed files with 24 additions and 5 deletions

View File

@@ -8,4 +8,28 @@
<PropertyGroup Label="ManifestToolOverride">
<ManifestTool Condition="Exists('$(WindowsSdkDir)bin\x64\mt.exe')">$(WindowsSdkDir)bin\x64\mt.exe</ManifestTool>
</PropertyGroup>
<!-- Auto-restore NuGet for native vcxproj (PackageReference) when building inside VS -->
<Target Name="EnsureNuGetRestoreForVcxproj"
BeforeTargets="PrepareForBuild"
Condition="
'$(BuildingInsideVisualStudio)' == 'true'
and '$(DesignTimeBuild)' != 'true'
and '$(RestoreInProgress)' != 'true'
and '$(MSBuildProjectExtension)' == '.vcxproj'
and '$(RestoreProjectStyle)' == 'PackageReference'
and '$(MSBuildProjectExtensionsPath)' != ''
and !Exists('$(MSBuildProjectExtensionsPath)project.assets.json')
">
<Message Importance="high"
Text="NuGet assets missing for $(MSBuildProjectName); running Restore..." />
<Message Importance="high" Text="IntDir=$(IntDir)" />
<Message Importance="high" Text="BaseIntermediateOutputPath=$(BaseIntermediateOutputPath)" />
<Message Importance="high" Text="MSBuildProjectExtensionsPath=$(MSBuildProjectExtensionsPath)" />
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="Restore"
Properties="RestoreInProgress=true"
BuildInParallel="false" />
</Target>
</Project>

View File

@@ -133,9 +133,6 @@
<Project>{17da04df-e393-4397-9cf0-84dabe11032e}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Manifest Include="PowerToys.exe.manifest" />
</ItemGroup>
@@ -149,7 +146,6 @@
<ItemGroup>
<!-- Remove ALL injected versions of the file -->
<ClCompile Remove="@(ClCompile)" Condition="'%(Filename)' == 'WindowsAppRuntimeAutoInitializer'" />
<!-- Add ONE copy back manually -->
<ClCompile Include="$(PkgMicrosoft_WindowsAppSDK_Foundation)\include\WindowsAppRuntimeAutoInitializer.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>

View File

@@ -118,7 +118,6 @@
<CopyFileToFolders Include="svgs\icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="runner.base.rc" />
</ItemGroup>
<ItemGroup>