Visual Studio 2008 - 添加引用

发布于 2024-07-07 07:18:21 字数 197 浏览 11 评论 0原文

当添加 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

遗弃M 2024-07-14 07:18:22

VS2008向bin目录添加了几个文件[...]它们需要添加到源代码管理中吗?

bin 目录中的任何内容都不需要添加到源代码管理中。 最初签入项目时的第一件事就是忽略 bin 和 obj 目录。 所以,是的,您可以删除这些文件,但 Visual Studio 会重新创建它们。

VS2008 adds several files to the bin directory [...]Do they need to be added in source control?

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.

治碍 2024-07-14 07:18:21

源代码控制:

Ben Straub 在这篇文章的评论中说道:如果需要,.dll.refresh 文件应添加到源代码控制中,而 .xml.pdb,当然还有.dll 文件不应添加。

John Rudy 解释了何时添加 .refresh 文件:

为什么这是一件好事(有时)?
假设您在一个团队中
环境。 有人签入代码
对于 foo.dll 和您的构建系统
构建一个新的 DLL,将其输出到
服务器上的文件共享。 你的刷新
文件指向该服务器副本
DLL。 下次构建时,VS 会
自动神奇地抓取最新的和
该 DLL 的最大副本。

.xml 就像 David Mohundro 所说:

xml 文件用于 XML 注释
和智能感知。 Visual Studio 将
解析并显示 XML
您致电时添加的评论
这些 DLL 中的方法。

.pdb 就像 David Mohundro 所说:

pdb 用于调试和
符号。 如果你遇到异常
从中抛出,你将能够得到
堆栈跟踪等。您可以控制
选择 PDB 是否
已建成。

.refresh 来自博客关于 .refresh 文件的帖子:

它告诉VS去哪里寻找更新的
具有相同基础的 dll 版本
姓名。 它们是文本文件,您可以打开
它们并查看它正在使用的路径。

他们的目的是阻止您
必须自己复制新版本。
在VS2003中,项目文件是
包含源位置
参考,但由于VS2005没有
使用 ASP.NET 的项目文件
项目,这是替代
该特定功能。

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:

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.

.xml like David Mohundro said:

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.

.pdb like David Mohundro said:

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.

.refresh from a blog post about .refresh files:

It tells VS where to look for updated
versions of the dll with the same base
name. They're text files, you can open
them and see the path it's using.

Their purpose is to prevent you from
having to copy new versions yourself.
In VS2003, the project file would
contain the source location of the
reference, but since VS2005 doesn't
use project files for ASP.NET
projects, this is the replacement for
that particular functionality.

你在我安 2024-07-14 07:18:21

刷新文件(因为还没有人知道它!)描述了 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.

宣告ˉ结束 2024-07-14 07:18:21

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.

眼眸里的那抹悲凉 2024-07-14 07:18:21

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文