Ghost application classCreation process, which isAsp.netThe key to how to combine the compilation and interpretation technologies.
This mode has two important roles:ParserAndCompiler,
Parser Responsible for explanation Application script (Global. asax) When using Code behind Technical, Parser Will load the pre-compiled Assembly , That is Global. dll , And use Reflection Technology extracts the class information. Then createSource code, And finally call Compiler To compile the sourceCodeObtain the object instance.
Another point: MultipleHttpapplicationWhy can objects be shared?Cache, application stateObjectWhat about it?
The answer is simple. These two objects are Httpruntime Object Management, Httpcontext , Httpapplication The object is simply a transfer action. Appdomain There will be Httpruntime Object exists.
from-in-depth analysis of Asp.net component design