From 1a592dcc51eb182961783a634031f8f1e9e78b5d Mon Sep 17 00:00:00 2001 From: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Date: Thu, 21 Aug 2025 10:20:17 -0500 Subject: [PATCH] Specify .NET Search by Build Type (#25837) Co-authored-by: Travis Plunk (HE/HIM) Co-authored-by: Travis Plunk --- PowerShell.Common.props | 21 +++++++++++++++++++++ build.psm1 | 21 ++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 28bc08cc5db..cfaddee74e3 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -176,6 +176,27 @@ portable + + + + EnvironmentVariable;Global + + + + + Global + + + + AppLocal + + true diff --git a/build.psm1 b/build.psm1 index 45705e53fa6..c60bec719f2 100644 --- a/build.psm1 +++ b/build.psm1 @@ -492,13 +492,24 @@ Fix steps: $Arguments += "/property:IsWindows=false" } - # Framework Dependent builds do not support ReadyToRun as it needs a specific runtime to optimize for. - # The property is set in Powershell.Common.props file. - # We override the property through the build command line. - if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) { - $Arguments += "/property:PublishReadyToRun=false" + # We pass in the AppDeployment property to indicate which type of deployment we are doing. + # This allows the PowerShell.Common.props to set the correct properties for the build. + $AppDeployment = if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) { + # Global and zip files + "FxDependent" + } + elseif($Options.Runtime -like 'fxdependent*' -and $Options.Runtime -match $optimizedFddRegex) { + # These are Optimized and must come from the correct version of the runtime. + # Global + "FxDependentDeployment" + } + else { + # The majority of our packages + # AppLocal + "SelfContained" } + $Arguments += "/property:AppDeployment=$AppDeployment" $Arguments += "--configuration", $Options.Configuration $Arguments += "--framework", $Options.Framework