asp.net中bin目录下的 dll.refresh文件

首先找到了这篇文章http://www.cnblogs.com/haokaibo/archive/2010/07/31/1789342.html

然后找到一篇英文的文章http://monsur.xanga.com/2006/02/03/dll-refresh-and-asp-net/

The question is so simple I wonder why I haven’t encountered it before:  If web projects in Visual Studio 2005 don’t have project files, how do they know where to get external references?  (Ok, well I guess the question isn’t that simple).

For example, suppose I have three dlls on a network share that I want to include in my web project.  I can do this using “add reference”.  But without a unifying project file, how does the next person know to load those same three references?

The usual suspects include the solution file and the web.config.  But the solution file contains only solution level information.  And while the web.config file has an “assemblies” section, it has nothing to do with external references.

It turns out, the answer lies in these simple but scary *.dll.refresh files that litter the bin directory.  Every time you add an external reference, you’ll find a dll.refresh file right next to it.

They are simple because if you view them in a text editor, you’ll see they contain nothing more than the full path to the dll.

They are scary because I’ve never seen them before, and we are conditioned to never, ever check your bin directory into source control.  In fact, I’ve been saying “WTF are these stupid refresh files!?” and then promptly deleting them.

Turns out, these dll.refresh files are an exception to the rule, and they should go into source control.  Its the only way your web project will know where its references live.

I can’t really find much information about these little files, just this bug report:

 

Thank you for your feedback. This is actually by design. If you are using source control, you do not want to store dynamically changing files such as a dll or pdb file. However, the refresh file contains information on where to get the dll and pdb, and should be saved. BTW, the presence of a refresh file indicates that the dll and pdb is dynamic and can change. If you do not have a refresh file, this indicates the dll and pdb are not dynamic. In this case, the dll and pdb *will* be checked into source control.

 

 

In the meantime, the ASP.NET team is working on a Web Application project for Visual Studio 2005.  This takes the best parts of VS2003 and fuses it with the best of VS2005 and ASP.NET 2.0.  This includes a single project file for the web project, which gets around the dll.refresh file issue.

 

 

中文的文章提出的解决方法是,另外建立一个文件夹,单独来存放第三方的dll

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(1184)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示