Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Layout/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<PropertyGroup>
<NetRuntimeRid Condition="'$(NetRuntimeRid)' == ''">$(HostRid)</NetRuntimeRid>
<NetRuntimeRid Condition="('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd' or '$(OSName)' == 'openbsd' or '$(OSName)' == 'illumos' or '$(OSName)' == 'solaris' or '$(OSName)' == 'haiku') and '$(DotNetBuildSourceOnly)' != 'true'">$(OSName)-$(TargetArchitecture)</NetRuntimeRid>
<NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('mariner.2.0'))">$(HostRid.Replace('mariner.2.0', 'cm.2'))</NetRuntimeRid>
<NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(HostRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid>
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition is based on NetRuntimeRid, but the replacement is applied to HostRid. If NetRuntimeRid is set explicitly (e.g., for cross/target layout generation), this will overwrite it with a value derived from the host RID (and potentially the host architecture), which can produce an incorrect runtime RID. Consider applying the replacement to $(NetRuntimeRid) (or, if the intent is host-only normalization, make the condition check HostRid.StartsWith(...) as well) so the same RID is used consistently.

Suggested change
<NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(HostRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid>
<NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(NetRuntimeRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid>

Copilot uses AI. Check for mistakes.

<SharedFrameworkRid>$(NetRuntimeRid)</SharedFrameworkRid>
<SharedFrameworkRid Condition="$(ProductMonikerRid.StartsWith('linux-musl'))">$(ProductMonikerRid)</SharedFrameworkRid>
Expand Down
Loading