Επεξεργασία

Κοινή χρήση μέσω


NETSDK1206: Found version-specific or distribution-specific runtime identifier(s)

NETSDK1206 indicates your project has assets for version-specific or distribution-specific runtime identifiers. In .NET 8 and higher, the runtime no longer considers version-specific or distro-specific RIDs by default and will find RID-specific assets using a known set of portable RIDs. The warning will list the RIDs and packages affected.

First, check for a newer version of any affected packages to see if they have moved to portable RIDs. Many packages have already moved to portable RIDs in their latest versions. If no such version exists, we recommend contacting the package authors to request switching the package to use only portable RIDs.

If you know your application does not actually need the specified RID—for example, it is not intended to run on the platform specified by the RID—you can suppress the warning using the NoWarn MSBuild property. For example:

<PropertyGroup>
  <NoWarn>$(NoWarn);NETSDK1206</NoWarn>
</PropertyGroup>

If your application does need the specified RID and the affected package doesn't have a version that uses portable RIDs, the runtime can be configured to perform asset resolution via the old RID graph with version-specific and distro-specific RIDs. Note that the old RID graph is no longer updated and exists only as a backwards compatibility option.

<ItemGroup>
  <RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
</ItemGroup>