本文介绍了什么时候加载CLR在.NET程序的组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- 是加载.NET程序集的 CLR 时,从组装一类是引用?
- Is a .NET assembly loaded by the CLR when a class from the assembly is referenced?
或
- 当一个类,它声明了使用空间从组件加载?
也已经加载的程序集,做它永远卸载组件如果不使用很长一段时间?
Also having loaded an assembly, does it ever unloads the assembly if it is not used for a long time?
推荐答案
这是JIT编译器指示CLR加载程序集一旦它翻译为机器code这是做点播的确切时间是不确定性。至于第二个问题,一旦一个程序集加载到AppDomain中,只有这样,才能卸载它是摧毁这个AppDomain中,有卸载的组件,没有别的办法。
It's the JIT compiler that instructs the CLR to load an assembly once it has translated it to machine code which is done on demand and the exact time is not deterministic. As to the second question, once an assembly is loaded into the AppDomain, the only way to unload it is to destroy this AppDomain, there's no other way to unload an assembly.
这篇关于什么时候加载CLR在.NET程序的组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!