What is assembly interning?

帅比萌擦擦* 提交于 2020-01-13 18:21:07

问题


What is assembly interning? For what purpose it is used for? I heard that it is a new feature added by ASP.Net 4.5. Can anyone please explain this feature. Is it same as String interning?


回答1:


From book Developing Windows Azure and Web Services:

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.




回答2:


From the 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.

Also check

  • Look at Sharing Common Assemblies in ASP.NET 4.5
  • What's new in ASP.NET? (Sharing Common Assemblies)


来源:https://stackoverflow.com/questions/30233857/what-is-assembly-interning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!