diff --git a/PowerShell.Common.props b/PowerShell.Common.props
index 45e1f2788c..ba5e6e2dff 100644
--- a/PowerShell.Common.props
+++ b/PowerShell.Common.props
@@ -136,7 +136,7 @@
(c) Microsoft Corporation.
net6.0
- 9.0
+ 10.0
true
true
@@ -144,6 +144,8 @@
true
true
en-US
+ true
+ true
true
../signing/visualstudiopublic.snk
diff --git a/build.psm1 b/build.psm1
index 6028c5fdc3..f988725049 100644
--- a/build.psm1
+++ b/build.psm1
@@ -437,6 +437,14 @@ Fix steps:
$Arguments += "--output", (Split-Path $Options.Output)
}
+ # Add --self-contained due to "warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used."
+ if ($Options.Runtime -like 'fxdependent*') {
+ $Arguments += "--no-self-contained"
+ }
+ else {
+ $Arguments += "--self-contained"
+ }
+
if ($Options.Runtime -like 'win*' -or ($Options.Runtime -like 'fxdependent*' -and $environment.IsWindows)) {
$Arguments += "/property:IsWindows=true"
}