How to check if a NuGet package changed its license
Some free .NET libraries have moved to paid or dual licenses. Finding out after an automatic update pulls in a new version is stressful and avoidable. This guide shows how to list what your projects use, read each package's license information and keep a simple record, using tools you already have.
1. Know what you depend on
Your project file lists the packages you chose, but each of those can pull in others. Those are called transitive dependencies, and a license change can hide there. Microsoft documents a command that lists both: dotnet package list --include-transitive. For the .NET 9 SDK and earlier, the same command is written dotnet list package, according to the same page.
Run it for each project or solution and save the output. The page also describes an --outdated option that shows which packages have newer versions available. That list tells you which upgrades are waiting.
- Save the output with the date, so you can compare next month.
- Include test projects and build tools, because a package there can end up in your delivery pipeline.
- Do this for every repository you ship from, not only the main one.
2. Read each package's license information
A NuGet package carries its license in its manifest, the .nuspec file. Microsoft's reference says the license element holds either a license expression, such as MIT, or the path to a license file inside the package. The older licenseUrl element is deprecated.
NuGet.org only accepts license expressions that are approved by the Open Source Initiative or the Free Software Foundation. A package that ships its own license text as a file is using terms that do not fit a standard expression, so that file needs to be read.
- For an expression, read the reference text at licenses.nuget.org, a Microsoft service that shows the text for each identifier.
- For a license file, open the package and read the whole file, not just the first lines.
- If the package shows only a link, open the link and note the date you looked.
3. Check whether the license changed between versions
A license belongs to a version. The version you use today may be under different terms from the newest one, so compare the license of your version with the version you are about to move to.
To find changes quickly, look at the project's own repository, release notes and announcements. An independent site called FOSSED keeps a list of 16 .NET libraries whose licensing changed, with the old license, the last free version and alternatives. Its list includes libraries such as AutoMapper, FluentAssertions, MassTransit, MediatR, Moq, Polly, EPPlus and QuestPDF. Treat any third-party list as a pointer, and confirm on the maintainers' own pages, because lists can be out of date.
- Write down the last version under the old terms.
- Note exactly which upgrade would cross into the new terms.
- Look for a thank-you or fee notice in the readme, not only in the license file.
4. Read the terms, not the headline
New terms differ a lot. Some ask for a fee above a revenue threshold, some charge per developer, some ask for a maintenance fee, and some offer the same code under two licenses. A headline tells you little, so read what the package's terms actually ask and whether they apply to your situation.
You then have a few ordinary choices: stay on the last version under the old terms, upgrade and follow the new terms, or replace the library. Staying put also means you stop getting fixes from newer versions, so write down who owns that decision. For anything with legal weight, ask someone qualified.
5. Make it a routine
A one-time check goes stale. Keep a small table and review it on a schedule, and always before you accept a bulk or automatic upgrade from tools such as Dependabot or Renovate.
- Columns: package, version in use, license, date checked, link to the source.
- Review monthly, and whenever someone adds a new package.
- Before merging an automated upgrade, check the new version's license against your record.
- Keep the table where someone can find it when your customers or your finance team ask what you depend on.
Where RelicensePier fits
RelicensePier is coming soon. It is built to automate the steps above: reading your project file, matching packages against known events with source links, showing which upgrade would cross a line and emailing you when a new event appears. Until then, the table and the monthly check work.
Sources
- Microsoft Learn: dotnet package list command
- Microsoft Learn: .nuspec file reference (license element)
- Microsoft Learn: licenses.nuget.org
- FOSSED: .NET libraries with license changes
Coming soon: RelicensePier
Get warned before a NuGet package starts asking for payment. RelicensePier takes your project file and shows which of your NuGet packages have a reported new fee or license change. It tells you the last version before the change and which upgrade would cross the line, and alerts you when a new event is added. It is for .NET teams that want to know before an automatic update pulls in a package with new terms.
Get RelicensePier first
Join the list and get 25% off your first purchase when it goes on sale. We email you a discount code on launch day. One code per person, for new customers.
One email when it launches (plus the discount code). No other mail, and you can say stop at any time. See our privacy policy.