Catálogo de RIDs do .NET.NET RID Catalog
RID é curto para o identificador de tempo de execução.RID is short for Runtime Identifier. Os valores do RID são usados para identificar plataformas de destino onde o aplicativo é executado.RID values are used to identify target platforms where the application runs.
Eles são usados por pacotes .NET para representar ativos específicos de plataforma em pacotes NuGet.They're used by .NET packages to represent platform-specific assets in NuGet packages. Os seguintes valores são exemplos de RIDs: linux-x64
, ubuntu.14.04-x64
, win7-x64
ou osx.10.12-x64
.The following values are examples of RIDs: linux-x64
, ubuntu.14.04-x64
, win7-x64
, or osx.10.12-x64
.
Para os pacotes com dependências nativas, o RID designará as plataformas em que o pacote pode ser restaurado.For the packages with native dependencies, the RID designates on which platforms the package can be restored.
Um único RID pode ser definido no elemento <RuntimeIdentifier>
do arquivo de projeto.A single RID can be set in the <RuntimeIdentifier>
element of your project file. Vários RIDs podem ser definidos como uma lista separada por ponto-e-vírgula no elemento <RuntimeIdentifiers>
do arquivo de projeto.Multiple RIDs can be defined as a semicolon-delimited list in the project file's <RuntimeIdentifiers>
element. Eles também são usados por meio da --runtime
opção com os seguintes comandos da CLI do .net:They're also used via the --runtime
option with the following .NET CLI commands:
- dotnet builddotnet build
- dotnet cleandotnet clean
- dotnet packdotnet pack
- dotnet publishdotnet publish
- dotnet restoredotnet restore
- dotnet rundotnet run
- dotnet storedotnet store
RIDs que representem sistemas operacionais concretos geralmente seguem este padrão: [os].[version]-[architecture]-[additional qualifiers]
em que:RIDs that represent concrete operating systems usually follow this pattern: [os].[version]-[architecture]-[additional qualifiers]
where:
[os]
é o moniker do sistema operacional/plataforma.[os]
is the operating/platform system moniker. Por exemplo,ubuntu
.For example,ubuntu
.[version]
é a versão do sistema operacional na forma de um separado de versão separado por ponto (.
).[version]
is the operating system version in the form of a dot-separated (.
) version number. Por exemplo,15.10
.For example,15.10
.- A versão não deve ser uma versão de marketing, pois essas geralmente representam várias versões distintas do sistema operacional com diferentes áreas de superfície de API da plataforma.The version shouldn't be marketing versions, as they often represent multiple discrete versions of the operating system with varying platform API surface area.
[architecture]
é a arquitetura do processador.[architecture]
is the processor architecture. Por exemplo:x86
,x64
,arm
ouarm64
.For example:x86
,x64
,arm
, orarm64
.[additional qualifiers]
distingue diferentes plataformas.[additional qualifiers]
further differentiate different platforms. Por exemplo:aot
.For example:aot
.
Gráfico RIDRID graph
O gráfico RID ou gráfico de fallback de runtime é uma lista de RIDs que são compatíveis entre si.The RID graph or runtime fallback graph is a list of RIDs that are compatible with each other. Os RIDs são definidos no pacote Microsoft.NETCore.Platforms.The RIDs are defined in the Microsoft.NETCore.Platforms package. Você pode ver a lista de RIDs com suporte e o grafo RID na runtime.jsno arquivo, que está localizado no dotnet/runtime
repositório.You can see the list of supported RIDs and the RID graph in the runtime.json file, which is located in the dotnet/runtime
repository. Nesse arquivo, você pode ver todos os RIDs, exceto para a base um, que contém uma instrução "#import"
.In this file, you can see that all RIDs, except for the base one, contain an "#import"
statement. Essas instruções indicam RIDs compatíveis.These statements indicate compatible RIDs.
Quando o NuGet restaura pacotes, ele tenta encontrar uma correspondência exata para o runtime especificado.When NuGet restores packages, it tries to find an exact match for the specified runtime. Se uma correspondência exata não for encontrada, o NuGet voltará ao gráfico até encontrar o sistema compatível mais próximo de acordo com o gráfico RID.If an exact match is not found, NuGet walks back the graph until it finds the closest compatible system according to the RID graph.
O exemplo a seguir é a entrada real para o RID osx.10.12-x64
:The following example is the actual entry for the osx.10.12-x64
RID:
"osx.10.12-x64": {
"#import": [ "osx.10.12", "osx.10.11-x64" ]
}
O RID acima especifica que osx.10.12-x64
importa osx.10.11-x64
.The above RID specifies that osx.10.12-x64
imports osx.10.11-x64
. Desse modo, quando o NuGet restaura pacotes, ele tenta encontrar uma correspondência exata para osx.10.12-x64
no pacote.So, when NuGet restores packages, it tries to find an exact match for osx.10.12-x64
in the package. Se o NuGet não puder encontrar o runtime específico, ele poderá restaurar pacotes que especificam runtimes osx.10.11-x64
, por exemplo.If NuGet cannot find the specific runtime, it can restore packages that specify osx.10.11-x64
runtimes, for example.
O seguinte exemplo mostra um gráfico RID ligeiramente maior, também definido no arquivo runtime.json:The following example shows a slightly bigger RID graph also defined in the runtime.json file:
win7-x64 win7-x86
| \ / |
| win7 |
| | |
win-x64 | win-x86
\ | /
win
|
any
Todos os RIDs eventualmente mapeiam para a raiz de any
RID.All RIDs eventually map back to the root any
RID.
Há algumas considerações sobre RIDs das quais você precisa se lembrar ao trabalhar com eles:There are some considerations about RIDs that you have to keep in mind when working with them:
- Não tente analisar RIDs para recuperar partes do componente.Don't try to parse RIDs to retrieve component parts.
- Não crie RIDs de modo programático.Don't build RIDs programmatically.
- Use RIDs que já estão definidos para a plataforma.Use RIDs that are already defined for the platform.
- Os RIDs precisam ser específicos, portanto, não presuma nada usando o valor RID real.The RIDs need to be specific, so don't assume anything from the actual RID value.
Usando RIDsUsing RIDs
Para poder usar RIDs, você precisa saber quais RIDs existem.To be able to use RIDs, you have to know which RIDs exist. Novos RIDs são adicionados regularmente à plataforma.New values are added regularly to the platform.
Para obter a versão mais recente e completa, consulte a runtime.jsno arquivo no dotnet/runtime
repositório.For the latest and complete version, see the runtime.json file in the dotnet/runtime
repository.
Os RIDs portáteis são valores adicionados ao grafo RID que não estão vinculados a uma versão ou distribuição de sistema operacional específica.Portable RIDs are values added to the RID graph that aren't tied to a specific version or OS distribution. Eles são a escolha preferida, especialmente ao lidar com vários distribuições do Linux, já que a maioria dos RIDs de distribuição são mapeados para os RIDs portáteis.They are the preferred choice, especially when dealing with multiple Linux distros since most distribution RIDs are mapped to the portable RIDs.
A lista a seguir mostra um pequeno subconjunto dos RIDs mais comuns usados para cada SO.The following list shows a small subset of the most common RIDs used for each OS.
RIDs do WindowsWindows RIDs
Apenas os valores comuns são listados.Only common values are listed. Para obter a versão mais recente e completa, consulte a runtime.jsno arquivo no dotnet/runtime
repositório.For the latest and complete version, see the runtime.json file in the dotnet/runtime
repository.
- PortáteisPortable
win-x64
win-x86
win-arm
win-arm64
- Windows 7 / Windows Server 2008 R2Windows 7 / Windows Server 2008 R2
win7-x64
win7-x86
- Windows 8.1 / Windows Server 2012 R2Windows 8.1 / Windows Server 2012 R2
win81-x64
win81-x86
win81-arm
- Windows 10 / Windows Server 2016Windows 10 / Windows Server 2016
win10-x64
win10-x86
win10-arm
win10-arm64
Para obter mais informações, consulte dependências e requisitos do .net.For more information, see .NET dependencies and requirements.
RIDs do LinuxLinux RIDs
Apenas os valores comuns são listados.Only common values are listed. Para obter a versão mais recente e completa, consulte a runtime.jsno arquivo no dotnet/runtime
repositório.For the latest and complete version, see the runtime.json file in the dotnet/runtime
repository. Os dispositivos que executam uma distribuição não listada abaixo podem funcionar com um dos RIDs Portáteis.Devices running a distribution not listed below may work with one of the Portable RIDs. Por exemplo, os dispositivos Raspberry Pi executando uma distribuição Linux não listada podem ser direcionados com linux-arm
.For example, Raspberry Pi devices running a Linux distribution not listed can be targeted with linux-arm
.
- PortáteisPortable
linux-x64
(A maioria das distribuições de área de trabalho como CentOS, Debian, Fedora, Ubuntu e derivativos)linux-x64
(Most desktop distributions like CentOS, Debian, Fedora, Ubuntu, and derivatives)linux-musl-x64
(Distribuições leves usando musl, como o Alpine Linux)linux-musl-x64
(Lightweight distributions using musl like Alpine Linux)linux-arm
(Distribuições do Linux em execução no ARM, como Raspbian no Raspberry Pi Model 2 +)linux-arm
(Linux distributions running on ARM like Raspbian on Raspberry Pi Model 2+)linux-arm64
(Distribuições do Linux em execução no ARM de 64 bits, como o Ubuntu Server 64-bit no modelo Raspberry Pi 3 +)linux-arm64
(Linux distributions running on 64-bit ARM like Ubuntu Server 64-bit on Raspberry Pi Model 3+)
- Red Hat Enterprise LinuxRed Hat Enterprise Linux
rhel-x64
(Substituído porlinux-x64
para RHEL acima da versão 6)rhel-x64
(Superseded bylinux-x64
for RHEL above version 6)rhel.6-x64
- TizenTizen
tizen
tizen.4.0.0
tizen.5.0.0
Para obter mais informações, consulte dependências e requisitos do .net.For more information, see .NET dependencies and requirements.
RIDs do macOSmacOS RIDs
Os RIDs do macOS usam a identidade visual “OSX” mais antiga.macOS RIDs use the older "OSX" branding. Apenas os valores comuns são listados.Only common values are listed. Para obter a versão mais recente e completa, consulte a runtime.jsno arquivo no dotnet/runtime
repositório.For the latest and complete version, see the runtime.json file in the dotnet/runtime
repository.
- PortáteisPortable
osx-x64
(A versão mínima do sistema operacional é macOS 10.12 Sierra)osx-x64
(Minimum OS version is macOS 10.12 Sierra)
- macOS 10.10 YosemitemacOS 10.10 Yosemite
osx.10.10-x64
- macOS 10.11 El CapitanmacOS 10.11 El Capitan
osx.10.11-x64
- macOS 10.12 SierramacOS 10.12 Sierra
osx.10.12-x64
- macOS 10.13 High SierramacOS 10.13 High Sierra
osx.10.13-x64
- macOS 10.14 MojavemacOS 10.14 Mojave
osx.10.14-x64
- macOS 10.15 CatalinamacOS 10.15 Catalina
osx.10.15-x64
- macOS 11, 1 Big SurmacOS 11.01 Big Sur
osx.11.0-x64
osx.11.0-arm64
Para obter mais informações, consulte dependências e requisitos do .net.For more information, see .NET dependencies and requirements.