Pages

02 September, 2021

Sitecore Upgrade - Codebase Upgrade - Migrate from packages.config to PackageReference

We have been always using packages.config file to manage the nuget package references. Instead of config file, PackageReference has been introduced to provide benefits for the developers. 

Benefits:

  1. Instead of showing all the dependencies in the packages.config file, only top level dependencies will be added as part of PackageReference. This gives a clean and simple view on the references. 
  2. Ability to manage all the project level configuration like package references in a single csproj file itself.
  3. Adding and removing packages are faster compared to Packages.config file. 
Migration of Packages.config to PackageReferences
To migration all the existing references, right-click the References node in Solution Explorer, and select the Migrate packages.config to PackageReference command.


Default to PackageReferences:
In order to add packages to PackageReferences by default, open Tools > NuGet Package Manager > Package Manager Settings menu, change the Default package management format to PackageReference.



No comments:

Post a Comment

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }