Visual Studio 2008 - 添加引用
当添加 DLL 作为对 ASP.Net 项目的引用时,VS2008 会向 bin 目录添加几个文件。 如果DLL名为foo.dll,VS2008会添加foo.dll.refresh、foo.pdb和foo.xml。 我知道foo.dll是什么:-),为什么VS2008添加了其他三个文件? 这三个文件有什么作用呢? 我可以删除它们吗? 是否需要将它们添加到源代码管理中?
When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is :-), why does VS2008 add the other three files? What do those three files do? Can I delete them? Do they need to be added in source control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
bin 目录中的任何内容都不需要添加到源代码管理中。 最初签入项目时的第一件事就是忽略 bin 和 obj 目录。 所以,是的,您可以删除这些文件,但 Visual Studio 会重新创建它们。
Nothing in the bin directory needs to be added to source control. One of the first thing when initially checking in a project is to ignore the bin and obj directories. So yes, you can delete these files, but Visual Studio will recreate them.
源代码控制:
Ben Straub 在这篇文章的评论中说道:如果需要,
.dll.refresh
文件应添加到源代码控制中,而.xml
、.pdb
,当然还有.dll
文件不应添加。John Rudy 解释了何时添加
.refresh
文件:.xml 就像 David Mohundro 所说:
.pdb 就像 David Mohundro 所说:
.refresh 来自博客关于 .refresh 文件的帖子:
Source Control:
Ben Straub said in a comment to this post: The
.dll.refresh
files should be added to the source control if required, while the.xml
,.pdb
and of course the.dll
files should not be added.John Rudy explained when to add the
.refresh
file:.xml like David Mohundro said:
.pdb like David Mohundro said:
.refresh from a blog post about .refresh files:
刷新文件(因为还没有人知道它!)描述了 DLL 的来源。 这是用于自动刷新参考; 每当您进行完整构建时,VS 都会查找该路径并复制该版本的 DLL。
为什么这是一件好事(有时)? 假设您处于团队环境中。 有人签入 foo.dll 的代码,您的构建系统会构建一个新的 DLL,并将其输出到服务器上的文件共享中。 您的刷新文件指向 DLL 的服务器副本。 下次构建时,VS 将自动神奇地获取该 DLL 的最新且最好的副本。
The refresh file (since no one's hit on that yet!) describes where the DLL came from. This is for auto-refresh references; whenever you do a full build, VS will look in that path and copy that version of the DLL.
Why is this a good thing (sometimes)? Let's say you're in a team environment. Someone checks in code for foo.dll, and your build system builds a new DLL, outputting it in a file share on a server. Your refresh file points to that server copy of the DLL. Next time you build, VS will auto-magically grab the latest and greatest copy of that DLL.
pdb 用于调试和符号。 如果从中抛出异常,您将能够获取堆栈跟踪等。您可以控制选择是否构建 PDB。 xml 文件用于 XML 注释和智能感知。 Visual Studio 将解析该内容并显示在调用这些 DLL 中的方法时添加的 XML 注释。
我不知道刷新文件。
The pdb is there for debugging and symbols. If you get an exception thrown from it, you'll be able to get stacktraces, etc. You're in control of choosing whether or not the PDB is built. The xml file is there for XML comments and intellisense. Visual Studio will parse that and display the XML comments that were added when you call methods in those DLLs.
I don't know about the refresh file.
foo.pdb 是 foo.dll 的调试器符号文件,您将需要它,否则您将无法在该代码中设置断点。
foo.pdb is the debugger symbols file for foo.dll, you'll want it or you won't be able to set a breakpoint in that code.