There are two basic components in the .NET Framework: common language run-time
( C L R ) a n d . N E T F r a m e w o r k c l a s s l i b r a r y. T h e C L R i s t h e f o u n d a t i o n o f t h e . N E T
Framework. The run-time library can be regarded as an agent who manages codes
d u r i n g e x e c u t i o n . T h e r u n - t i m e l i b r a r y p r o v i d e s c o r e s e r v i c e s ( s u c h a s m e m o r y
m a n a g e m e n t , t h r e a d m a n a g e m e n t a n d r e m o t e m a n a g e m e n t ) , a n d f o r c e s t h e
e x e c u t i o n o f s t r i c t t y p e s e c u r i t y a n d c o d e a c c u r a c y i n o t h e r f o r m s t h a t e n s u r e s
security and reliability. In fact, the code management concept is the basic principle of
t h e r u n - t i m e l i b r a r y . C o d e s t a k i n g t h e r u n - t i m e l i b r a r y a s t h e o b j e c t a r e c a l l e d
managed codes, while codes not taking the run-time library as the object are called
u n m a n a g e d c o d e s . A n o t h e r b a s i c c o m p o n e n t o f t h e . N E T F r a me w o r k i s t h e c l a s s
library, which is a comprehensive object-oriented reusable type collection. You can
use the class library to develop various applications, including traditional command
l i n e s o r G U I a p p l i c a t i o n s , a n d a p p l i c a t i o n s b a s e d o n t h e l a t e s t i n n o v a t i o n s o f
ASP.NET (such as Web forms and XML Web services).
The .NET Framework can be carried by unmanaged components. These unmanaged
c o m p o n e n t s l o a d t h e C L R t o t h e i r p r o c e s s e s , a n d s t a r t m a n a g e d c od e e x e c u t i o n ,
t h u s c r e a t i n g a s o f t w a r e e n v i r o n m e n t t h a t c a n u s e b o t h t r u s t a n d u n m a n a g e d
functions at the same time. The .NET Framework not only provides multiple run-time
library hosts, but also supports the development of third-party run-time library hosts.
For example, the run-time library carried by ASP.NET can provide a scalable server-
side environment for managed codes. ASP.NET directly uses the run-time library to
start ASP.NET applications and XML Web services (ASP.NET applications and XML
Web services are discussed later in this section).
The Internet Explorer is an example of carrying unmanaged applications of the run-
t i m e l i b r a r y ( i n t h e f o r m o f M I M E c l a s s e x p a n s i o n ) . U s i n g t h e I n t e r n e t E x p l o r e r t o
carry the run-time library enables you to embed managed components or Windows
form controls in the HTML file. This mode makes managed mobile codes (similar to
the Microsoft® ActiveX® control) possible, and obtains important improvements (such
a s p a r t i a l l y b e l i e v a b l e e x e c u t i o n , a n d s e c u r e i n d e p e n d e n t f i l e s t o r a g e ) t h a t o n l y
managed code can provide.
The following figure shows the relationships between the CLR & class library and the
a p p l i c a t i o n s a n d b e t w e e n t h e C L R & c l a s s l i b r a r y a n d t h e e n t i r e s y s t e m . T h e
following figure also shows how the managed code runs in a larger structure.
8