【问题标题】:Visual Studio 2015/ TFS 2013 not ignoring bower_components in ASP.NET 5 projectsVisual Studio 2015/TFS 2013 没有忽略 ASP.NET 5 项目中的 bower_components
【发布时间】:2015-10-13 16:07:38
【问题描述】:

Visual Studio 2015 没有忽略 bower_components 文件夹,尽管它忽略了 node_modules,所以我不知道出了什么问题。

这是我的project.json的内容

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta7",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta7"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": { }   
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ]
}

如何强制 VS 2015 从项目树中隐藏 bower_components 文件夹?

我也在为 TFS 2013 苦苦挣扎,因为我无法忽略跟踪更改的文件夹。我尝试过 .tfignore,但没有成功。

【问题讨论】:

  • 我遇到了完全相同的问题。 node_modules 和 bin 文件夹被删除,但 bower_components 保留。这给我带来了一个巨大的问题,因为我使用的 resharper、intellisense 和其他工具不断想要“处理”这个文件夹,从而使 VS 变得无用。
  • 如果你使用 Git,你需要将它提供给你的 gitignore 文件。有人说 Bower 组件应该在版本控制上,而其他人则不然。取决于如果从 github 删除包会发生什么:D
  • 嗨@MattOverall,检查下面的答案。

标签: visual-studio-2015 asp.net-core-mvc tfignore


【解决方案1】:

这个问题现在通过使用“从解决方案资源管理器中隐藏”选项得到“修复”,该选项在 ASP.NET 5 beta 8 版本中可用。

请关注this link 了解更多信息。请查看该页面上的“ASP.NET 5 的 Visual Studio 2015 新功能”部分。

关注 this link 下载更新并安装 Visual Studio 2015

【讨论】:

  • 感谢您的更新。很高兴知道我没有遗漏任何明显的东西。您是否偶然知道 bin 和 node_modules 是如何被隐藏的?
  • 它们是如何隐藏的并不明显,但似乎有一个预定义文件夹列表,VS2015 在设计上会忽略这些文件夹,例如 bin 和 node_modules
  • 也许我不明白答案,但这只是将文件隐藏在解决方案资源管理器中。它们仍然不会被 TFS 忽略,并且仍会添加到待处理的更改中。
猜你喜欢
  • 2016-11-02
  • 2016-02-13
  • 1970-01-01
  • 2014-06-03
  • 2015-03-20
  • 2015-12-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多