diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index 7f27cd3c4..84464b624 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -132,7 +132,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. <_FilesToDelete Include="$(GeneratedFilesDir)**"/> <_FilesToDelete Include="$(CppWinRTMergedDir)**"/> <_FilesToDelete Include="$(CppWinRTUnmergedDir)**"/> - <_FilesToDelete Include="$(CppWinRTProjectWinMD)"/> + <_FilesToDelete Include="$(CppWinRTProjectWinMD)" Condition="'$(CppWinRTGenerateWindowsMetadata)' == 'true'"/>