如何防止 VS2015 NuGet 将包添加到 TFS

编程入门 行业动态 更新时间:2024-10-28 08:16:37
本文介绍了如何防止 VS2015 NuGet 将包添加到 TFS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

VS2013 有一个错误,即 NuGet 会将包添加为挂起的更改,即使您使用 .tfignore 告诉它不要这样做.有一个 workaround,但它不适用于 VS2015/NuGet3,并且 NuGet 又回到了它的旧技巧.是否有Nu"解决方法?:-)

Microsoft Connect 项目:NuGet 将包添加到 TFS,尽管 .tfignore

解决方案

看起来这个问题在 - 至少更新到这个版本对我有用.

关于这个问题的讨论可以在这里找到,建议更新从 NuGet 3.1 到 3.2 RC.

更新

该扩展的 3.2 版现已发布(找到 此处),其中包括此修复程序.

澄清

要完成这项工作,您需要两件事:

  • 包含 disableSourceControlIntegration 设置的 nuget.config 文件
  • 遵循 disableSourceControlIntegration 设置的 NuGet Visual Studio 2015 扩展版本(3.2 及更高版本应该可以使用)
  • 如 文档:

    NuGet 首先从默认位置加载 NuGet.config,然后加载任何名为 NuGet.config 的文件,从当前驱动器的根目录开始,到当前目录结束.

    这意味着您可以在 您的用户配置文件的默认配置文件(找到在 %APPDATA%NuGetNuGet.Config)或解决方案目录中的 NuGet 配置文件中,例如 MySolution.NuGetNuGet.config.p>

    VS2013 had a bug where NuGet would add packages as pending changes, even if you told it not to with .tfignore. There was a workaround, but it doesn't work with VS2015/NuGet3, and NuGet is back to its old tricks. Is there a "Nu" workaround? :-)

    Microsoft Connect item: NuGet adds packages to TFS despite .tfignore

    解决方案

    It looks like this is fixed in version 3.2 RC of the NuGet Visual Studio 2015 Extension - updating to this version worked for me, at least.

    A discussion about this issue can be found here where it is recommended to update from NuGet 3.1 to 3.2 RC.

    Update

    Version 3.2 of the extension has now been released (found here) which includes this fix.

    Clarification

    To get this working you need two things:

  • A nuget.config file containing the disableSourceControlIntegration setting
  • A version of the NuGet Visual Studio 2015 Extension that respects the disableSourceControlIntegration setting (versions from 3.2 onward should work)
  • As indicated in the docs:

    NuGet first loads NuGet.config from the default location, then loads any file named NuGet.config starting from the root of the current drive and ending in the current directory.

    This means that you can specify <solution><add key="disableSourceControlIntegration" value="true" /></solution> in the default config file for your user profile (found at %APPDATA%NuGetNuGet.Config) or in the NuGet config file in your solution directory, e.g., MySolution.NuGetNuGet.config.

    更多推荐

    如何防止 VS2015 NuGet 将包添加到 TFS

    本文发布于:2023-11-16 22:27:00,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1607724.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何防止   TFS   NuGet

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!