Skip to content

Commit 8e6314f

Browse files
authored
Add NativeMethods.txt to AdditionalDesignTimeBuildInput (#1557)
1 parent c706c28 commit 8e6314f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Microsoft.Windows.CsWin32/build/Microsoft.Windows.CsWin32.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,14 @@
9393
<FileWrites Include="@(CsWin32GeneratorOutputs)" />
9494
<FileWrites Include="$(CsWin32GeneratorGeneratedFilesList)" Condition="Exists('$(CsWin32GeneratorGeneratedFilesList)')" />
9595
</ItemGroup>
96+
9697
</Target>
98+
99+
<!-- Add the items to AdditionalDesignTimeBuildInput as well so that DesignTimeBuilds re-run when NativeMethods.txt contents change.
100+
VS seems to evaluate this directly (not looking at the DesignTimeBuild outputs) and so we can't do it in a Target.
101+
And VS doesn't support conditions on FileName or things like that in a top-level ItemGroup so just include all AdditionalFiles
102+
as ContentSensitive. Worst case the DesignTimeBuild runs on files other than NativeMethods.txt. -->
103+
<ItemGroup Condition="'$(CsWin32RunAsBuildTask)'=='true'">
104+
<AdditionalDesignTimeBuildInput Include="@(AdditionalFiles)" ContentSensitive="true" />
105+
</ItemGroup>
97106
</Project>

0 commit comments

Comments
 (0)