diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 186a9afc2114..e5ba50f256cb 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -72,11 +72,12 @@ Copyright (c) .NET Foundation. All rights reserved. '$(RuntimeIdentifier)' == '' and '$(_IsExecutable)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsRidAgnostic)' != 'true' and + '$(_IsPublishing)' == 'true' and ( '$(SelfContained)' == 'true' or - ('$(_IsPublishing)' == 'true' and '$(PublishReadyToRun)' == 'true') or - ('$(_IsPublishing)' == 'true' and '$(PublishSingleFile)' == 'true') or - ('$(_IsPublishing)' == 'true' and '$(PublishAot)' == 'true') + '$(PublishReadyToRun)' == 'true' or + '$(PublishSingleFile)' == 'true' or + '$(PublishAot)' == 'true' )">true