diff --git a/PowerShell.Common.props b/PowerShell.Common.props
index 5dce6eac9a..7f62f8c5dc 100644
--- a/PowerShell.Common.props
+++ b/PowerShell.Common.props
@@ -176,6 +176,23 @@
portable
+
+
+ Global
+
+
+
+ EnvironmentVariable;Global
+
+
+
+ AppLocal
+
+
true
diff --git a/build.psm1 b/build.psm1
index 34d79670fb..ed3735f4c9 100644
--- a/build.psm1
+++ b/build.psm1
@@ -492,13 +492,22 @@ 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
+ "GlobalTool"
+ }
+ elseif($Options.Runtime -like 'fxdependent*' -and $Options.Runtime -match $optimizedFddRegex) {
+ # EnvironmentVariable, Global
+ "FxDependent"
+ }
+ else {
+ # AppLocal
+ "SelfContained"
}
+ $Arguments += "/property:AppDeployment=$AppDeployment"
$Arguments += "--configuration", $Options.Configuration
$Arguments += "--framework", $Options.Framework