Skip to content

Commit dc23244

Browse files
authored
Infer self-contained and RID for PublishAot
1 parent dbfe834 commit dc23244

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Copyright (c) .NET Foundation. All rights reserved.
7878
<PropertyGroup Condition="'$(UseCurrentRuntimeIdentifier)' == ''">
7979
<UseCurrentRuntimeIdentifier Condition="
8080
'$(RuntimeIdentifier)' == '' and
81-
'$(_IsExecutable)' == 'true' and '$(IsTestProject)' != 'true' and
81+
('$(_IsExecutable)' == 'true' and '$(IsTestProject)' != 'true' or '$(PublishAot)' == 'true') and
8282
'$(IsRidAgnostic)' != 'true' and
8383
(
8484
'$(SelfContained)' == 'true' or
@@ -147,6 +147,8 @@ Copyright (c) .NET Foundation. All rights reserved.
147147
<PropertyGroup>
148148
<!-- Detecting property presence is not harmful and can be done in an unconditioned way -->
149149
<_SelfContainedWasSpecified Condition="'$(SelfContained)' != ''">true</_SelfContainedWasSpecified>
150+
<!-- PublishAot implies SelfContained -->
151+
<SelfContained Condition="'$(SelfContained)' == '' and '$(PublishAot)' == 'true'">true</SelfContained>
150152
</PropertyGroup>
151153
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(HasRuntimeOutput)' == 'true'">
152154
<SelfContained Condition="'$(SelfContained)' == '' and '$(RuntimeIdentifier)' != ''">true</SelfContained>

0 commit comments

Comments
 (0)