{"id":15374529,"url":"https://github.com/olsh/dotnet-consolidate","last_synced_at":"2025-06-15T19:38:40.285Z","repository":{"id":39241450,"uuid":"252661686","full_name":"olsh/dotnet-consolidate","owner":"olsh","description":".NET core command-line tool that verifies that all NuGet packages in a solution are consolidated","archived":false,"fork":false,"pushed_at":"2024-05-01T12:23:11.000Z","size":112,"stargazers_count":29,"open_issues_count":7,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T06:12:39.593Z","etag":null,"topics":["command-line","command-line-tool","consolidate","dotnet","nuget"],"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/olsh.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,"publiccode":null,"codemeta":null}},"created_at":"2020-04-03T07:28:19.000Z","updated_at":"2025-01-16T06:43:12.000Z","dependencies_parsed_at":"2023-10-01T20:20:53.549Z","dependency_job_id":"ebe88b3f-681a-45ee-88dd-c14adcacf97c","html_url":"https://github.com/olsh/dotnet-consolidate","commit_stats":{"total_commits":34,"total_committers":5,"mean_commits":6.8,"dds":0.4117647058823529,"last_synced_commit":"64a9cf130d84cfc5d65ae85765e5d1960c460783"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fdotnet-consolidate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fdotnet-consolidate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fdotnet-consolidate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fdotnet-consolidate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olsh","download_url":"https://codeload.github.com/olsh/dotnet-consolidate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830398,"owners_count":21168272,"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":["command-line","command-line-tool","consolidate","dotnet","nuget"],"created_at":"2024-10-01T13:58:58.824Z","updated_at":"2025-04-14T06:12:46.568Z","avatar_url":"https://github.com/olsh.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotnet consolidate\n\n[![Build status](https://ci.appveyor.com/api/projects/status/k8hwnc4d6d897vc8?svg=true)](https://ci.appveyor.com/project/olsh/dotnet-consolidate)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dotnet-consolidate\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=dotnet-consolidate)\n[![NuGet](https://img.shields.io/nuget/v/dotnet-consolidate.svg)](https://www.nuget.org/packages/dotnet-consolidate/)\n\n.NET core tool that verifies that all NuGet packages in a solution are consolidated.\n\n\u003e Developers typically consider it bad practice to use different versions of the same NuGet package across different projects in the same solution. \n\u003e \n\u003e https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#consolidate-tab\n\nThe tool finds such discrepancies.\n\n## Installation\n\n`dotnet tool install dotnet-consolidate --global`\n\n## Usage\n\nPass a solution file as a parameter\n\n`dotnet consolidate -s YourSolution.sln`\n\nor multiple solutions\n\n`dotnet consolidate -s YourSolution.sln AnotherSolution.sln`\n\nYou can also optionally specify the a package ID if you want only a single package to be consolidated\n\n`dotnet consolidate -s YourSolution.sln -p PackageId`\n\nor a list of package IDs if you want to consolidate multiple, but not all which are referenced in the solution projects\n\n`dotnet consolidate -s YourSolution.sln -p PackageID1 PackageID2`\n\nAlternatively, you can configure the opposite, package IDs that should be skipped during consolidation:\n\n`dotnet consolidate -s YourSolution.sln -e ExcludedPackageID1 ExcludedPackageID2`\n\nIt's also possible to skip a pattern of versions during consolidation with a regular expression:\n\n`dotnet consolidate -s YourSolution.sln --excludedVersionsRegex .*-alpha$`\n\nWith this, if e.g one of the projects in the solution uses `MyPackage` v1.0.0, and another project `MyPackage` v1.1.0-alpha, then no discrepancy will be indicated.\n\nIf the tool finds discrepancies between projects (only the specified ones if -p is given), it exits with non-success status code and prints these discrepancies.\n\n## Examples\n\n`dotnet consolidate -s umbraco.sln`\n\n:white_check_mark: Output:\n\n```\nAll packages are consolidated.\n```\n\n`dotnet consolidate -s Sentry.sln`\n\n:x: Output:\n\n```\nFound 5 non-consolidated packages\n\n----------------------------\nNewtonsoft.Json\n----------------------------\nSentry - 11.0.2\nSentry - 6.0.8\n\n----------------------------\nMicrosoft.Extensions.Logging.Configuration\n----------------------------\nSentry.Extensions.Logging - 2.1.0\nSentry.Extensions.Logging - 3.0.0\n\n----------------------------\nMicrosoft.Extensions.DependencyInjection\n----------------------------\nSentry.AspNetCore - 2.1.0\nSentry.Extensions.Logging.Tests - 2.1.1\nSentry.Extensions.Logging.Tests - 3.0.0\n\n----------------------------\nMicrosoft.Extensions.Configuration.Json\n----------------------------\nSentry.Extensions.Logging.Tests - 2.1.1\nSentry.Samples.GenericHost - 2.1.1\nSentry.Extensions.Logging.Tests - 3.0.0\n\n----------------------------\nMicrosoft.AspNetCore.TestHost\n----------------------------\nSentry.Testing - 2.1.1\nSentry.Testing - 3.1.0\n```\n\n## Testing a development version of the tool locally from source\n\nRun the following commands in `src/DotNet.Consolidate`:\n\n```powershell\ndotnet build\ndotnet pack\n```\n\nThe package will be created under `bin/Release`.\n\nOpen the folder of the solution where you want to test the tool, then run:\n\n```powershell\ndotnet tool install dotnet-consolidate --local --add-source  \u003cfull path of bin/Release\u003e\ndotnet consolidate -s YourSolution.sln\n```\n\nWhen you're finished, you can also uninstall it to clean up:\n\n```powershell\ndotnet tool uninstall dotnet-consolidate\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsh%2Fdotnet-consolidate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folsh%2Fdotnet-consolidate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsh%2Fdotnet-consolidate/lists"}