This is the documentation for the original tool
dotnet-fix-references
. You should migrate to the new one.
A dotnet global tool that aids with bulk solution and project file references changes.
dotnet tool install --global dotnet-fix-references --version 0.0.9
Note: If using this in a scripted process you want to be consistent (like a build), you should pin to a specific version with
--version x.y.z
.
Supports the following modes which have varying use cases.
By passing a root directory, the tool will assume that the current directory structure is the source of truth and will fix all project references inside all .sln and .csproj files to the correct relative path.
dotnet fix-references ./src
Use cases:
- You have moved your source code into a new folder structure (via a script or otherwise) and don't want to manually updates all your project references in .sln and .csproj files. (Project file names must be the same).
By passing a .sln or .csproj file, the tool will assume the entry point Fix locations of .csproj files by providing a .sln (or .csproj file, coming soon) entry point (assumes the project references in the files are correct, a.k.a. file-first)
dotnet fix-references Company.Project.sln . true
Use cases:
- Overcoming Dockerfile COPY globbing limitations... See here.
Coming soon...
Use cases:
- You've consolidated separate projects (and packages) into a mono repo and want to swap all package references to local project references where possible.
Will do if there's interest or I have a need. (Bit more complicated than 3 as you'd be searching package sources rather than local file system.
Use cases:
- You've split out from a mono repo to NuGet packages...
Every version until v1.0 could contain breaking changes. You should definitely pin to specific versions until then.
This tool updates/deletes files in-place. Backup anything you care about before running this tool.