https://github.com/mysticmind/dotnet-sort-refs
A .NET Core global tool to alphabetically sort package references in your .NET Core and .NET Standard projects.
https://github.com/mysticmind/dotnet-sort-refs
Last synced: 3 months ago
JSON representation
A .NET Core global tool to alphabetically sort package references in your .NET Core and .NET Standard projects.
- Host: GitHub
- URL: https://github.com/mysticmind/dotnet-sort-refs
- Owner: mysticmind
- License: mit
- Created: 2019-03-22T13:57:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-29T17:56:45.000Z (over 1 year ago)
- Last Synced: 2025-03-28T02:53:04.179Z (3 months ago)
- Language: C#
- Size: 36.1 KB
- Stars: 41
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# dotnet-sort-refs
[](https://ci.appveyor.com/project/BabuAnnamalai/dotnet-sort-refs) [](https://www.nuget.org/packages/dotnet-sort-refs/)A .NET Core global tool to alphabetically sort package references in your .NET Core and .NET Standard projects.
If you have benefitted from this library and has saved you a bunch of time, please feel free to buy me a coffee!
![]()
## Why use this tool?
References and package references in a project file are the most updated parts. Sorting the references helps with the following:
- Easier merges on source control (git). Without sorting the package references in the project file, you may end up with more merge conflicts to fix.
- It will be easier to go through the list of package references if you manually edit the file or view changes using a diff tool.## Installation
```bash
dotnet tool install --global dotnet-sort-refs
```## Usage
```text
dotnet sort-refs [arguments] [options]Arguments:
Path The path to a .csproj, .fsproj or directory. If a directory is specified, all .csproj and .fsproj files within folder tree will be processed. If none specified, it will use the current directory.Options:
--version Show version information
-?|-h|--help Show help information
-i|--inspect Specifies whether to inspect and return a non-zero exit code if one or more projects have non-sorted package references.
```Note: `dotnet sort-refs` and `dotnet-sort-refs` are valid usages to run the tool.