Skip to content

Commit dd21c87

Browse files
CopilotJanProvaznik
andcommitted
Simplify fix: Only add PrepareResources dependency
Removed CallTarget approach which was based on incorrect understanding of MSBuild. _GenerateCompileInputs is already a dependency via DependsOnTargets, and MSBuild will ensure it runs before _GenerateCompileDependencyCache within the same invocation. The real fix is just adding PrepareResources to dependencies to ensure resource metadata (OutputResource) is set before _GenerateCompileInputs runs. This is the minimal change needed to fix the NoBuild issue while preserving PR #10928's caching benefit. Co-authored-by: JanProvaznik <[email protected]>
1 parent 33d17a9 commit dd21c87

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Tasks/Microsoft.Common.CurrentVersion.targets

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,12 +3846,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
38463846
contribute to incremental build inconsistencies.
38473847
============================================================
38483848
-->
3849-
<Target Name="_GenerateCompileDependencyCache" Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingProject)' == 'true'" DependsOnTargets="ResolveAssemblyReferences;PrepareResources">
3850-
3851-
<!-- Explicitly call _GenerateCompileInputs to ensure _CoreCompileResourceInputs is populated.
3852-
This is necessary because in NoBuild scenarios, _GenerateCompileInputs may be skipped by MSBuild's
3853-
target skipping logic, leaving _CoreCompileResourceInputs empty. Using CallTarget ensures it runs. -->
3854-
<CallTarget Targets="_GenerateCompileInputs" />
3849+
<Target Name="_GenerateCompileDependencyCache" Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingProject)' == 'true'" DependsOnTargets="ResolveAssemblyReferences;PrepareResources;_GenerateCompileInputs">
38553850
<ItemGroup>
38563851
<CustomAdditionalCompileInputs Include="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" />
38573852
<CoreCompileCache Include="@(Compile)" />

0 commit comments

Comments
 (0)