1

I have a number of C# projects that all share the same packages and external references. In order to keep all packages up to date across all solutions is there a way I can use a central "packages.config" rather than an individual one for each project?

Thanks all

FYI I am using visual studio 2019.

BillyDay
  • 37
  • 1
  • 4
  • 14
  • 2
    Check out [this answer](https://stackoverflow.com/a/56737180/3791245) to basically the same question. tl;dr is No, packages.config can't be used across solutions. But [switching from packages.config to Package Reference](https://learn.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference) gives you more flexibility to address this kind of thing, via something like Directory.Build.props. – Sean Skelly Sep 17 '20 at 17:04

1 Answers1

1

You might be able to use a link to a common file, but you shouldn't.

Not all projects need the same items and references and you shouldn't overload the projects with unneeded items.

Package.Config is meant to be project related. Once a package is in a project, it is also a row in the project.json or csproj file referencing the dll. Without it the package.config is irrelevant.

Visual studio itself, if you manage the packages on solution level, edits the project files and adds package config file on each individual project. This is the expected behavior.

Athanasios Kataras
  • 25,191
  • 4
  • 32
  • 61