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