简体   繁体   English

对所有 C# 项目使用中央 packages.config

[英]Using central packages.config for all C# projects

I have a number of C# projects that all share the same packages and external references.我有许多 C# 项目,它们都共享相同的包和外部引用。 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?为了在所有解决方案中保持所有包都是最新的,有没有一种方法可以使用中央“packages.config”而不是每个项目的单独一个?

Thanks all谢谢大家

FYI I am using visual studio 2019.仅供参考,我正在使用 Visual Studio 2019。

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. Package.Config旨在与项目相关。 Once a package is in a project, it is also a row in the project.json or csproj file referencing the dll.一旦包在项目中,它也是project.jsoncsproj文件中引用 dll 的一行。 Without it the package.config is irrelevant.没有它 package.config 是无关紧要的。

Visual studio itself, if you manage the packages on solution level, edits the project files and adds package config file on each individual project. Visual Studio 本身,如果您在解决方案级别管理包,则编辑项目文件并在每个单独的项目上添加包配置文件。 This is the expected behavior.这是预期的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM