{"id":16632259,"url":"https://github.com/benmccallum/dotnet-references","last_synced_at":"2025-10-30T04:30:17.498Z","repository":{"id":46148264,"uuid":"211360629","full_name":"benmccallum/dotnet-references","owner":"benmccallum","description":"A dotnet global tool for working with references in solution and project files","archived":false,"fork":false,"pushed_at":"2024-04-06T06:11:05.000Z","size":81,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-22T13:04:49.564Z","etag":null,"topics":["csproj-tooling","docker","dotnet-core","dotnet-global-tool","github-actions"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benmccallum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-27T16:30:47.000Z","updated_at":"2023-12-13T17:29:24.000Z","dependencies_parsed_at":"2024-03-18T10:59:29.362Z","dependency_job_id":"2dbfe764-9552-4ca9-b475-6a0f7995fc08","html_url":"https://github.com/benmccallum/dotnet-references","commit_stats":null,"previous_names":["benmccallum/dotnet-fix-references"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmccallum%2Fdotnet-references","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmccallum%2Fdotnet-references/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmccallum%2Fdotnet-references/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmccallum%2Fdotnet-references/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benmccallum","download_url":"https://codeload.github.com/benmccallum/dotnet-references/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238930129,"owners_count":19554122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csproj-tooling","docker","dotnet-core","dotnet-global-tool","github-actions"],"created_at":"2024-10-12T04:59:36.669Z","updated_at":"2025-10-30T04:30:17.161Z","avatar_url":"https://github.com/benmccallum.png","language":"C#","funding_links":["https://www.buymeacoffee.com/benmccallum"],"categories":[],"sub_categories":[],"readme":"# dotnet references\n\n![Nuget](https://img.shields.io/nuget/dt/dotnet-references) \u003ca href=\"https://www.buymeacoffee.com/benmccallum\" target=\"_blank\"\u003e\u003cimg src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\nA [dotnet global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) \nthat aids with bulk solution and project file references changes and related directory \norganisation.\n\n(Formerly `dotnet-fix-references`, see prior documentation for it [here](docs/README-dotnet-fix-references.md).)\n\n# Installation\n\n```dotnet tool install --global dotnet-references```\n\n\u003e 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`.\n\n# Usage\n\n```\nUsage: dotnet-references \u003cMode\u003e [options]\n\nArguments:\n  Mode                                       The mode to run (fix or internalise)\n\nOptions:\n  -ep|--entry-point                          The entry point to use (a .sln file or a directory)\n  -wd|--working-directory                    The working directory to use (under which all .sln and .csproj files are contained). \n                                             If not provided, defaults to directory of entry point.\n  -rupf|--remove-unreferenced-project-files  Should unreferenced project files be removed?\n                                             (Caution! Deletes files! Only supported in fix mode).\n  -reig|--remove-empty-item-groups           Should ItemGroup elements in project files that are empty be removed?\n                                             (Only supported in internalise mode).\n  -?|-h|--help                               Show help information\n```\n\nSupports the following modes which have varying use cases.\n\n## Mode 1: Fix\nThis mode can fix references between solution files and projects in one of two ways.\n\n\u003e :warning: If the dotnet cli complains with \"Specify which project file to use because this '...' contains more than one project file.\", you've run into a limitation of the dotnet cli. A workaround is to execute from any random directory and utilise the `-ep` and `-wd`  args. (eg. `mkdir temp \u0026\u0026 cd temp \u0026\u0026 dotnet references fix -ep ../ -wd .. -rupf` (or `-ep ../Company.Project.sln -wd ..`)).\n\n### Directory-first \nBy passing a directory as the entry, 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.\n\n\u003e dotnet references fix -ep ./src\n\nUse cases:\n 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).\n\n### File-first\nBy passing a .sln file, the tool will assume that it, and the path it references .csproj files, is the source of truth; thus moving the .csproj files into the correct directory structure.\n\n\u003e dotnet references fix -ep Company.Project.sln\n\nUse cases:\n1. Overcoming Dockerfile COPY globbing limitations... See [here](docs/Dockerfile-use-case.md).\n\n## Mode 2: Internalise (PackageReference --\u003e ProjectReference)\nThis mode \"internalises\" references, by turning package references to project references.\n(The project name must be the same as the package name).\n\n\u003e dotnet references internalise -wd ./src\n\nUse cases:\n1. You've consolidated separate projects (and packages) into a mono repo and want to swap all package references to local project references where possible.\n\nNote: It currently doesn't handle transitive dependencies (dependencies of dependencies), which you'll need to add manually.\n\n# Word of warning\nThis tool updates/deletes files in-place. Backup anything you care about before running this tool. \n\n# Feature backlog\n1. Support fix mode w/ .csproj entry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenmccallum%2Fdotnet-references","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenmccallum%2Fdotnet-references","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenmccallum%2Fdotnet-references/lists"}