DLL在bin和GAC两个,其中一个被使用? [英] Dll in both the bin and the gac, which one gets used?

查看:662
本文介绍了DLL在bin和GAC两个,其中一个被使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个的部署,只有前端的变化很多网站的Web应用程序,共享的后端部分有它在GAC DLL,所以我们只需要更新一个DLL和所有的网站获取更新。

We have a web application that's deployed to many websites with only frontend changes, the shared backend portion has it's DLL in the GAC so we only have to update that one dll and all the sites get the update.

有没有办法在/ bin文件夹一个DLL来测试新功能,以覆盖GAC他们得到释放之前?

Is there a way to override the GAC with a DLL in the /bin folder to test out new features before they get released?

推荐答案

如果它具有相同的版本号为引用的DLL时,GAC被使用。

If it has the same version number as the referenced DLL, the GAC gets used.

如果您增加版本号,重建网站引用新的版本号,把新版本中的/ bin目录下,然后该DLL将被使用。

If you increment the version number, rebuild the website referencing the new version number, put the new version in the /bin directory, then that DLL will be used.

如果您不想更改版本号,你是pretty太多的运气。

If you do not want to change the version number, you're pretty much out of luck.

在.NET负荷强命名程序集,首先它试图决定使用什么样的版本号。它通过参考做这第一个,然后查找出版商政策,然后查找< A HREF =htt​​p://msdn.microsoft.com/en-us/library/7wd6ex19%28vs.71%29.aspx>绑定重定向配置文件英寸

When .NET loads strong named assemblies, first it tries to decide what version number to use. It does this via the reference first, then it looks for publisher policies, then it looks for binding redirects in the configuration file.

在它这样做,它看起来在GAC组装,然后在任意的 codeBase的规定,那么它探测的DLL各种文件系统文件夹。如果在找到正确的版本,组装这些步骤中的任何一个,它会停止。

After it does this, it looks for the assembly in the GAC, then in any codebase specified, then it probes various file system folders for the DLL. If at any one of those steps it finds the right version assembly, it stops.

如果你不改变你强命名程序集的版本号,.NET会发现,原来一个在GAC望而止步。请注意,因为它停止当它发现一个,因为看在GAC首先,指定为您装配一个codeBase的没有什么好处,除非您还指定一个新的版本号。

If you are not changing the version number of your strong named assembly, .NET will find the original one in the GAC and stop looking. Note that because it stops when it finds one, and because looking in the GAC is first, specifying a codebase for your assembly will do no good unless you also specify a new version number.

这篇关于DLL在bin和GAC两个,其中一个被使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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