.dtbcache 文件有什么作用? [英] What does the .dtbcache file do?

查看:67
本文介绍了.dtbcache 文件有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 C# WinForms 项目,我正在 Visual Studio 2017 中处理它(尽管它最初是在 2015 版本中创建的).

I have a C# WinForms project, which I am working on in Visual Studio 2017 (although it was originally created in the 2015 version).

我不记得做过什么特别的事情,但它添加了一个名为 .dtbcache 的文件,它想添加到 git 中.该文件没有扩展名,Google 搜索未显示任何结果.

I don't recall having done anything special, but it has added a file called .dtbcache, that it wants to add to git. The file has no extension, and a Google search doesn't show any results.

该文件位于 ..\repos\myprject\.vs\MyProject\DesignTimeBuild.这意味着文件名的dtb"部分可能意味着 design time b uild,但这并没有真正做到好多了.

The file is located in ..\repos\myprject\.vs\MyProject\DesignTimeBuild. Which means that the "dtb" part of the file name probably means design time build, but that doesn't really make it that much better.

我可以删除它或将它添加到 .gitignore 吗?我不想将它包含在我们的 git 存储库中,除非它是必需的.

Can I delete it or add it to .gitignore? I would prefer not to include it in our git repository, unless it is required.

推荐答案

简短回答:您可以安全地从 Git 存储库中排除它.

Short answer: You can safely exclude it from your Git repo.

长答案:

你说得对,dtb 代表设计时构建.这是VS2017自动创建的文件,有更多信息此处此处(链接到从事 Visual Studio 项目系统 工作人员的博客).总而言之,Visual Studio 或多或少会推断将生成哪些文件,以确保 Intellisense 按预期完全可用.

You're right that dtb stands for Design Time Build. This is a file automatically created by VS2017, with a bit more information here and here (links to a blog from someone working on the Visual Studio project system). In summary, it's Visual Studio more or less extrapolating what files will be produced in order to make sure Intellisense is fully available as intended.

从链接的文章来看,这样做的目的之一是确保 Visual Studio 在某些情况下有答案:

From the linked articles, one of the purposes of this is to make sure Visual Studio has an answer in certain cases:

  • 给定项目文件中的程序集引用,该引用将在编译时实际引用磁盘上的哪个程序集?
  • 给定一个 XAML 文件,XAML 编译器将在编译时生成的代码是什么样的?
  • 给定一个 glob 文件模式 (*.cs),在编译时实际上会包含哪些文件?

因此,您的 Git 存储库中不需要动态生成的文件,可以安全地排除这些文件.此外,据我所知,这些文件是由 Visual Studio 2017 专门制作和使用的.

So the files, being generated on the fly, are not needed in your Git repo, and can safely be excluded. Moreover, from what I can tell, these files are specifically made and used by Visual Studio 2017.

这篇关于.dtbcache 文件有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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