Skip to content

Commit 2ebac33

Browse files
Update Language Version to 10 and fix related issues (PowerShell#15886)
1 parent 0a34260 commit 2ebac33

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

PowerShell.Common.props

+3-1
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,16 @@
136136
<Copyright>(c) Microsoft Corporation.</Copyright>
137137

138138
<TargetFramework>net6.0</TargetFramework>
139-
<LangVersion>9.0</LangVersion>
139+
<LangVersion>10.0</LangVersion>
140140
<PublishReadyToRun Condition=" '$(Configuration)' != 'Debug' ">true</PublishReadyToRun>
141141

142142
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
143143
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
144144
<GenerateDocumentationFile>true</GenerateDocumentationFile>
145145
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
146146
<NeutralLanguage>en-US</NeutralLanguage>
147+
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
148+
<DisableImplicitNamespaceImports_DotNet>true</DisableImplicitNamespaceImports_DotNet>
147149

148150
<DelaySign>true</DelaySign>
149151
<AssemblyOriginatorKeyFile>../signing/visualstudiopublic.snk</AssemblyOriginatorKeyFile>

build.psm1

+8
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,14 @@ Fix steps:
437437
$Arguments += "--output", (Split-Path $Options.Output)
438438
}
439439

440+
# Add --self-contained due to "warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used."
441+
if ($Options.Runtime -like 'fxdependent*') {
442+
$Arguments += "--no-self-contained"
443+
}
444+
else {
445+
$Arguments += "--self-contained"
446+
}
447+
440448
if ($Options.Runtime -like 'win*' -or ($Options.Runtime -like 'fxdependent*' -and $environment.IsWindows)) {
441449
$Arguments += "/property:IsWindows=true"
442450
}

0 commit comments

Comments
 (0)