Microsoft .NET Upgrade Assistant: Centralized Package Management (CPM)
The latest version of the .NET Upgrade Assistant includes exciting new features that make upgrading .NET projects even easier and more efficient. In particular, support for Centralized Package Management (CPM) has been introduced, which is a significant improvement for developers who want to migrate their projects to the latest version of .NET.
What is the .NET Upgrade Assistant?
The .NET Upgrade Assistant is a handy tool that helps developers upgrade their existing .NET solutions to a newer version of .NET. Whether you're upgrading from .NET Framework to .NET 8 or switching between different versions of .NET, this tool not only shows you what changes are required but also automates many of these adjustments. The .NET Upgrade Assistant is both Visual Studio extension as well as Command-line tool available.
New features in the current version
The latest version of the .NET Upgrade Assistant introduced a particularly useful feature: the ability to deploy projects to NuGet. Central Package Management (CPM). CPM allows you to manage all NuGet packages centrally, instead of defining versions directly in the project files. This significantly simplifies the maintenance and updating of package dependencies in large solutions.
This is how the upgrade to CPM works in Visual Studio
To migrate a project in Visual Studio to CPM, you need the .NET Upgrade Assistant extension. Right-clicking the project node in the Solution Explorer and selecting "Upgrade" opens a new feature for centralized package management. Here, you can choose whether to migrate only the current project or all projects in your solution to CPM. The Assistant also offers options for migrating to the SDK style and managing web projects, which, due to a lack of official support, should often be updated separately.
Upgrade via the command line
For developers who prefer working with the command line, the .NET Upgrade Assistant also offers a CLI version for upgrading to CPM. After starting the tool with the command `upgrade-assistant upgrade`, you can select projects and perform the upgrade. Here, too, the tool offers a variety of customization options, such as switching to the SDK style or adding a JSON configuration file for more precise control of the upgrade process.
What happens behind the scenes?
After the upgrade is complete, the package references in the projects are switched to the central package management system. Instead of version entries directly in the .csproj files, all package versions are stored in a central file called Directory.packages.props. This not only simplifies the maintenance of package dependencies but also ensures consistent versioning across all projects.
Furthermore, the way the tool detects and modifies project dependencies has been improved. Instead of directly editing the project files, it now intervenes where the dependencies are actually defined, such as in Directory.Build.props or Directory.Packages.props.
Further improvements
In addition to the new features for CPM, the .NET Upgrade Assistant has also improved the tool's accessibility. Both the Visual Studio tool and the HTML report it generates are now more compatible with screen readers and other assistive technologies.
Changes in Visual Studio support
From now on, the .NET Upgrade Assistant is only supported by Visual Studio version 17.3 and higher. Older versions must be updated to the latest version to continue receiving security updates and the latest features.

