Skip to content

Commit 5884467

Browse files
authored
[release/9.0.3xx] Run AddImplicitDefineConstants after PrepareForBuild. (#47790)
2 parents b9891ee + f3686d5 commit 5884467

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Copyright (c) .NET Foundation. All rights reserved.
252252
</Target>
253253

254254
<!--
255-
Add implicitly defined preprocessor symbols to DefineConstants. Note: this is intentionally using 'BeforeCompile' as
255+
Add implicitly defined preprocessor symbols to DefineConstants. Note: this is intentionally using 'PrepareForBuild' as
256256
trigger to ensure that it runs before the XamlPreCompile targets. This targets creates the intermediate XAML project
257257
that is used by some XAML-based UI frameworks (eg. UWP XAML, WinUI 3). If it runs before AddImplicitDefineConstants,
258258
and the code has any '#ifdefs' on constants generated by this target (eg. 'NET9_0_OR_GREATER'), the intermediate XAML
@@ -262,7 +262,7 @@ Copyright (c) .NET Foundation. All rights reserved.
262262
<Target Name="AddImplicitDefineConstants"
263263
Condition=" '$(DisableImplicitFrameworkDefines)' != 'true' "
264264
DependsOnTargets="GenerateTargetPlatformDefineConstants;GenerateNETCompatibleDefineConstants;GeneratePlatformCompatibleDefineConstants;_DisableDiagnosticTracing"
265-
BeforeTargets="BeforeCompile" >
265+
AfterTargets="PrepareForBuild" >
266266
<PropertyGroup>
267267
<DefineConstants Condition=" '@(_ImplicitDefineConstant)' != '' " >$(DefineConstants);@(_ImplicitDefineConstant)</DefineConstants>
268268
<FinalDefineConstants Condition=" '@(_ImplicitDefineConstant)' != '' and '$(Language)' == 'VB' " >$(FinalDefineConstants),@(_ImplicitDefineConstant->'%(Identity)=-1', ',')</FinalDefineConstants>

0 commit comments

Comments
 (0)