简体   繁体   English

在文本编辑器中编辑Package.Config后,Nuget软件包还原了吗?

[英]Nuget Package Restore, upon editing Package.Config, in Text Editor?

When merging two projects, we're in need of Install-Package several 100 times. 合并两个项目时,我们需要几百次Install-Package Doesn't Nuget support package restore, once Package.config is edited. 编辑Package.config后,Nuget不支持软件包还原。 The way it works like charm for Node JS package? 它的工作方式就像Node JS包的魅力一样?

Once package.config is edited, why can't we fire Update-Package to restore all packages? 一旦package.config被编辑,为什么我们不能启动Update-Package来还原所有软件包?

在此处输入图片说明

Is it supported in the successor Dotnet CLI? 后续的Dotnet CLI是否支持?

While packages.config tells NuGet which packages to download and extract (for which target framework), the process of installing package references may also modify the .csproj file. 虽然packages.config告诉NuGet要下载和解压缩哪个软件包(针对哪个目标框架),但安装软件包引用的过程也可能会修改.csproj文件。 So if you update only one of these after a merge, you could find yourself trouble. 因此,如果在合并后仅更新其中之一,则可能会遇到麻烦。

The successor of this mechanism is PackageReference ( NuGet blog post ), which replaces packages.config and only requires listing the referenced packages and versions (and even some additional MSBuild logic could be used by projects to manage shared versions / packages etc.). 该机制的后继者是PackageReferenceNuGet博客文章 ),它替换了packages.config ,只需要列出所引用的软件包和版本(甚至项目可以使用某些其他MSBuild逻辑来管理共享的版本/软件包等)。 However, there is no migration tool available, so you'd need to uninstall all packages and add the package references you need. 但是,没有可用的迁移工具,因此您需要卸载所有软件包并添加所需的软件包引用。 Some NuGet features also changes - for example the support fo content files (=> files copied into the project directory) was removed which may still be used by some projects (eg web projects assuming that jQuery or other JS libraries would be acquired in this way). NuGet的某些功能也发生了变化-例如,删除了支持content文件(=>复制到项目目录中的文件),这些文件可能仍被某些项目(例如,假定将以这种方式获取jQuery或其他JS库的Web项目)使用。 )。

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

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