Skip to content

Commit 8579da1

Browse files
Fix Visual Studio rebuilding issue (LT-22423)
* Make Visual Studio use MSBuild logic to determine if project artifacts are up to date * Also clean up some cruft in Directory.Build.props
1 parent 5711bf6 commit 8579da1

File tree

1 file changed

+3
-41
lines changed

1 file changed

+3
-41
lines changed

Directory.Build.props

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
3+
<!-- Disable Visual Studio's project up to date checking so that a build with build.ps1 will not result in a re-build -->
4+
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
45
<!--
56
MSB3277/MSB3243: Assembly version conflicts are BUILD ERRORS.
67
CPM + transitive pinning (Directory.Packages.props) prevents version drift.
@@ -66,7 +67,7 @@
6667
Version declarations are centrally managed in Directory.Packages.props.
6768
-->
6869
<PropertyGroup Label="AssemblyInfo Policy">
69-
<!--
70+
<!-- TODO: Fix the location of the Include and remove the CommonAssemblyInfo from all .csproj files
7071
CommonAssemblyInfoTemplate Policy:
7172
All managed projects must link Src/CommonAssemblyInfo.cs to ensure consistent versioning and metadata.
7273
When linking the template, disable SDK auto-generation to prevent CS0579 duplicate attribute errors.
@@ -117,40 +118,8 @@
117118

118119
<ItemGroup>
119120
<Compile Remove="**/*.template.cs" />
120-
<!--
121-
Test Exclusion Policy (Pattern A):
122-
All test code must be explicitly excluded using the pattern:
123-
<Compile Remove="<ProjectName>Tests/**" />
124-
<None Remove="<ProjectName>Tests/**" />
125-
126-
Wildcards (e.g. *Tests/**) are NOT allowed.
127-
Nested test folders must also be explicitly excluded.
128-
-->
129121
</ItemGroup>
130122

131-
<!--
132-
Stale obj/ Folder Policy:
133-
Since SDK migration, intermediate output uses centralized location: $(FwRoot)Obj/$(Configuration)/<ProjectName>/
134-
135-
Old per-project obj/ folders (Src/**/obj/) should not exist.
136-
If they do, build.ps1 automatically removes them before building.
137-
138-
IMPORTANT: Do NOT use ItemGroup Remove patterns here to exclude stale files.
139-
The SDK's GenerateTargetFrameworkMonikerAttribute target adds files AFTER
140-
Directory.Build.props is evaluated, so such patterns are ineffective.
141-
The cleanup in build.ps1 is the correct solution.
142-
143-
If you encounter CS0579 duplicate attribute errors, run:
144-
Get-ChildItem -Path Src -Filter obj -Directory -Recurse | Remove-Item -Recurse -Force
145-
Or simply run .\build.ps1 which does this automatically.
146-
-->
147-
<!--
148-
WPF/XAML Compilation Memory Optimization:
149-
XAML compilation can cause OOM errors in memory-constrained builds (parallel builds).
150-
These settings help reduce memory pressure:
151-
- XamlDebuggingInformation: Disable extra debugging info in Release (smaller assemblies)
152-
- UseRidGraph: Use RID graph directly instead of creating temp projects
153-
-->
154123
<PropertyGroup Condition="'$(UseWPF)' == 'true'">
155124
<XamlDebuggingInformation Condition="'$(Configuration)' == 'Release'">false</XamlDebuggingInformation>
156125
<UseRidGraph>true</UseRidGraph>
@@ -177,13 +146,6 @@
177146
-->
178147
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS0168;CS0169;CS0219;CS0414;CS0649;168;169;219;414;649</WarningsNotAsErrors>
179148
</PropertyGroup>
180-
181-
<!--
182-
Test infrastructure PackageReferences have moved to Src/Directory.Build.props
183-
to scope them to Src/ projects only (Build/Src FwBuildTasks manages its own test versions).
184-
Version declarations are centrally managed in Directory.Packages.props.
185-
-->
186-
187149
<!--
188150
Shared test assembly attributes: SLDR offline mode, ICU initialization, registry redirect, etc.
189151
This is applied to all test projects that don't already include the file.

0 commit comments

Comments
 (0)