packages.config to PackageReference

Paste a packages.config and, if you can, the project file beside it. You get the ItemGroup of PackageReference elements to put in the project, the list of assembly references and imports that have to come out of it, and the steps to finish. Converted in your browser; nothing is sent anywhere.

Finishing the migration

1. Paste the ItemGroup into the project file
Anywhere inside <Project>. Remove the <None Include="packages.config" /> item while you are there.
2. Remove what the notes list
Assembly references whose HintPath points into the packages folder, imported .targets and .props files, and the EnsureNuGetPackageBuildImports target. PackageReference supplies all of them.
3. Restore and build
Delete packages.config and the packages folder, restore, build. Fix any assembly that was referenced from the packages folder but is not in the list (a package that was removed from packages.config by hand but whose reference stayed).
4. Prune
packages.config listed every package, including the ones only there because another needs them. Remove any you never use directly; they come back transitively.

Why bother

PackageReference is the only format modern .NET understands, and the SDK-style project file that goes with it is a tenth of the size of the old one. Visual Studio has a built-in migrator for the same job; this page does it where there is no Visual Studio to hand, shows every change rather than making it, and works on project files that the migrator refuses.

Before converting, it is worth knowing which packages will survive the move at all: the NuGet upgrade planner checks each one for vulnerabilities, deprecation and support for .NET 8 or 10. The web.config converter handles the configuration side.

Moving a .NET Framework project to modern .NET?

Our fixed-price upgrade assessment goes through the packages, the project files and the code, and sets out the route before anything is changed.

Tell us about your system 0800 433 7990 Monday to Friday, 9am to 5pm. A first 20-minute call is free, and we reply to every enquiry within one working day. What happens after you get in touch