【问题标题】:How to get visual studio 2013 source control to ignore the packages directory如何让 Visual Studio 2013 源代码控制忽略包目录
【发布时间】:2015-03-22 14:35:55
【问题描述】:

我正在使用 nuget 自动还原(较新版本,而不是 MSBuild 集成还原)。当我构建我的解决方案时,所有依赖项都会被下载,但是,Visual Studio 总是将包目录添加到源代码控制中(我使用的是 TFS)。我尝试更新 .tfignore 文件并添加带有 <add key="disableSourceControlIntegration" value="true" /> 的 .nuget/NuGet.config。但似乎没有任何效果。如何让 Visual Studio 和 tfs 忽略包目录?

【问题讨论】:

    标签: visual-studio tfs nuget


    【解决方案1】:

    解决方法是右键单击解决方案,然后单击“启用 NuGet 包还原”。

    然后将以下内容添加到 .tfignore:

    \packages*
    

    编辑:我最初关注了instructions here for auto restore,但没有成功。然后我启用了 Nuget 包还原,如上所述。这有效,但已弃用(如@Daniel Mann 所述)。最后,我关注了instructions here for migrating to auto restore,现在一切正常。我不知道这是否是正确的程序,但它对我有用。

    【讨论】:

    • 使用 Visual Studio 集成的“启用 NuGet 包还原”(除了 nuget.config 之外,还添加了 NuGet.targets 和 nuget.exe)已弃用。请不要使用它——有关更多信息,请参阅:docs.nuget.org/docs/workflows/…
    • 那么最好不要将 nuget 包签入 TFS 吗?
    猜你喜欢
    • 1970-01-01
    • 2018-05-05
    • 1970-01-01
    • 2014-06-03
    • 1970-01-01
    • 2014-12-06
    • 2011-02-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多