简体   繁体   English

迁移到NuGet自动包还原

[英]Migrating to NuGet Automatic Package Restore

I am migrating MSBuild-Integrated package restore to Automatic Package Restore which became available with v2.7 of NuGet. 我正在将MSBuild集成包恢复迁移到自动包恢复 ,这可以在NuGet的v2.7中使用。 Steps are easy to follow but I am confused with part that mentions .nuget/NuGet.Config 步骤很容易遵循,但我对提到.nuget/NuGet.Config部分感到困惑

If I create a new solution with few projects, Automatic Package Restore "just works" and there is no .nuget folder at the solution level at all... 如果我创建一个包含很少项目的新解决方案,自动包恢复“只是工作”并且解决方案级别根本没有.nuget文件夹...

  1. So why does migration doc mention I need to leave it? 那么为什么迁移文档提到我需要离开呢? It works if I remove it... 它可以工作,如果我删除它...
  2. I read in the docs that one possible advantage of leaving it is that " Using this approach, rather than cloaking the packages folder or otherwise ignoring it, allows NuGet to completely skip the call into Visual Studio to pend changes to the packages folder. " Is that it? 我在文档读到 ,离开它的一个可能的优点是“ 使用这种方法,而不是隐藏包文件夹或以其他方式忽略它,允许NuGet完全跳过调用Visual Studio以挂起对包文件夹的更改。 ”是那呢? Is this a big advantage (as opposed to having a cleaner solution)? 这是一个很大的优势(而不是有一个更清洁的解决方案)?

NOTE: I am using Git in TFS and not TVSVC. 注意:我在TFS中使用Git而不是TVSVC。

That NuGet.Config file is only for Team Foundation Server (TFS). 该NuGet.Config文件仅适用于Team Foundation Server(TFS)。 If you are not using TFS, then you can safely remove it. 如果您没有使用TFS,那么您可以安全地删除它。 To quote Migrating MSBuild-Integrated solutions to use Automatic Package Restore : 引用迁移MSBuild集成解决方案以使用自动包还原

By default, the NuGet.Config file instructs NuGet to bypass adding package binaries to source control. 默认情况下,NuGet.Config文件指示NuGet绕过将包二进制文件添加到源代码控制。 Automatic Package Restore will honor this as long as you leave this file in place. 只要您将此文件保留在原位,自动包恢复就会遵守此规则。 Note that NuGet.Config only has an effect when using Visual Studio to integrate with Team Foundation Server (TFS). 请注意,使用Visual Studio与Team Foundation Server(TFS)集成时,NuGet.Config才有效。

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

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