From d92015e37cc10e391b61055ebbde2bd3e04f681f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 11 Feb 2026 19:11:31 -0500 Subject: [PATCH] [release/v7.5] Specify .NET search by build type (#26408) --- 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 28bc08cc5d..cfaddee74e 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 45705e53fa..c60bec719f 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