什么是装配实习?

What is assembly interning?

什么是装配实习?它的用途是什么? 听说是ASP.Net4.5新增的功能。 谁能解释一下这个功能。和字符串实习一样吗?

来自MSDN

ASP.NET

Bin assemblies interning (sharing common assemblies): The ASP.NET shadow copy feature enables assemblies that are used in an application domain to be updated without unloading that AppDomain (necessary because the CLR locks assemblies that are being used). This is done by copying application assemblies to a separate location (either a default CLR-determined location or a user-specified one) and loading the assemblies from that location. This allows the original assembly to be updated while the shadow copy is locked. ASP.NET turns on this feature by default for Bin folder assemblies so that DLLs can continue to be updated while a site is up and running.

同时检查

摘自《开发 Windows Azure 和 Web 服务》一书:

ASP.NET has a feature called shadow copying that enables assemblies that are used in an application domain to be updated without unloading the AppDomain. Normally, this is required because the Common Language Runtime (CLR) will lock the assemblies so you can’t just copy a new assembly over it. Shadow copying means that the original assembly is copied to a temporary location. The copied assembly is locked, and the original assembly can be updated with a new version.

ASP.NET 4.5 adds a new feature called assembly interning. Because all DLLs are already located in one location (the Temporary ASP.NET Files folder), interning analyzes this folder for duplicate assemblies. Those assemblies are then moved to a special location, and all the original references are replaced with what’s called a symbolic link.