-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add article for RID-specific, self-contained and AOT .NET tools #49874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive documentation for RID-specific and AOT-enabled .NET tools, a feature introduced in .NET SDK 10.0.100-preview.6. The documentation enables tool authors to package and distribute platform-specific, native, and trimmed .NET tools.
- New article
rid-specific-tools.mddocumenting the complete workflow for creating RID-specific tools - Cross-reference links added to existing tool documentation
- TOC entry added for the new article
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| docs/core/tools/rid-specific-tools.md | New comprehensive guide covering RID-specific tool configuration, packaging workflows for AOT and non-AOT scenarios, package structure, and complete examples |
| docs/core/tools/global-tools.md | Added cross-reference link to new RID-specific tools article |
| docs/core/tools/global-tools-how-to-create.md | Added "See also" section with link to RID-specific tools article |
| docs/navigate/tools-diagnostics/toc.yml | Added TOC entry for new RID-specific tools article |
|
@baronfel this is ready for your review. Let me know if there's any details I can clarify or add. |
| dotnet pack -r osx-arm64 | ||
| ``` | ||
|
|
||
| You must run each RID-specific pack command on the matching platform because AOT compilation produces native binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about linking to https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot here for further guidance about NAOT publishing? I was thinking of a call to action like
Learn more about the prerequisites for Native AOT compilation at Native AOT deployment.
What do you think?
| Publish all packages to NuGet.org or your package feed by using [dotnet nuget push](dotnet-nuget-push.md): | ||
|
|
||
| ```dotnetcli | ||
| dotnet nuget push mytool.1.0.0.nupkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying each package is possible, but I find people often just do
dotnet nuget push path/to/package/root/*.nupkg
| ## Install a RID-specific tool | ||
|
|
||
| Users install RID-specific tools the same way as regular tools: | ||
|
|
||
| ```dotnetcli | ||
| dotnet tool install -g mytool | ||
| ``` | ||
|
|
||
| The CLI automatically: | ||
|
|
||
| 1. Downloads the top-level package. | ||
| 1. Reads the RID-specific metadata. | ||
| 1. Identifies the most appropriate package for the current platform. | ||
| 1. Downloads and installs the RID-specific package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we highlight dnx instead of tool installation in this section?
## Run a RID-specific tool
Users run RID-specific tools the same way as platform-agnostic tools:
> dnx mytool
1. Downloads the top-level package.
1. Reads the RID-specific metadata.
1. Identifies the most appropriate package for the current platform.
1. Downloads and runs the RID-specific package.
...
Summary
Adds comprehensive documentation for RID-specific and AOT-enabled .NET tools introduced in SDK 10.0.100-preview.6, enabling platform-specific distribution of native, trimmed tools.
Changes
New Article:
rid-specific-tools.mdDocuments the complete workflow for creating platform-specific tools:
RuntimeIdentifiersorToolPackageRuntimeIdentifiersMSBuild propertiesdotnet packgenerates N+1 packages (one per RID + pointer)dotnet pack -r <RID>on target systemsDotnetTool(metadata) vsDotnetToolRidPackage(binaries)Cross-references
global-tools-how-to-create.mdandglobal-tools.mdExample Configuration
Produces packages:
mytool.1.0.0.nupkg,mytool.win-x64.1.0.0.nupkg,mytool.linux-x64.1.0.0.nupkg,mytool.osx-arm64.1.0.0.nupkgOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Internal previews