如何防止 VS2015 NuGet 向 TFS 添加包 [英] How to keep VS2015 NuGet from adding packages to TFS

查看:16
本文介绍了如何防止 VS2015 NuGet 向 TFS 添加包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

解决方案

看起来这在 版本 3.2 RC - 更新到此版本至少对我有用.

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

更新

扩展的 3.2 版现已发布(找到 此处) 包含此修复程序.

澄清

要使其正常工作,您需要做两件事:

  1. 包含 disableSourceControlIntegration 设置的 nuget.config 文件
  2. 遵循 disableSourceControlIntegration 设置的 NuGet Visual Studio 2015 扩展版本(3.2 及以后的版本应该可以使用)

文档:

<块引用>

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

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

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:

  1. A nuget.config file containing the disableSourceControlIntegration setting
  2. 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 添加包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆