惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
I
InfoQ
腾讯CDC
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
量子位
博客园_首页

博客园 - 无心三立

zz蚂蚁算法概述zz zz遗传算法 Genetic Algorithm 简介zz 推荐一个网站:我爱自然语言处理http://www.52nlp.cn/ zz几本自然语言处理入门书zz 机器学习的开源工具<转载> 噪声信道模型zz 如何成为一名成功的博士生[转载] 为什么读博士以及有什么意义[转载] The first of my blog write in English 拍电影--真实和虚拟 蔡學鏞 - .NET中间语言 前天去听讲座 乔家大院 家居风水大全[ZT:http://sssyyyccc.blog.hexun.com/2641355_d.html] 没事就到博客看看,随便写点,成习惯了 我的时间该怎么分配 转贴--生活小技巧--感觉不错,就贴上来了 厕所对联(纯属搞笑) 女教师与学生的精彩对答(超级爆笑)
Applied Microsoft .net framework Programming---Chapter 1
无心三立 · 2006-03-05 · via 博客园 - 无心三立

Chapter 1: The Architecture of the .NET Framework Development Platform
1. Compiling Source code into managed modules
    Microsoft is creating several language compilers that target the runtime: C++ with managed extensions, C#, Visual Basic, JScript, and an intermediate language(IL) assembler. In addition to Microsoft, several other compilers are creating compilers that produce code that targets the CLR. You can create source code files using any programming language that supports the CLR, then you use the corresponding compiler to check the syntax and annlyze the source code. Regardless of which compiler you use, the result is a managed module. A managed module is a standard Windows Portable executable(PE) file that requires the CLR to execute.
    The parts of managed module: PE header, CLR header, Metadata, IL code.
    Of all the Microsoft compilers mentioned, C++ is unique in that it is the only language that allows the developer to write both managed and unmanaged code and have it emitted into a single module.

2. Combining Managed Modules into Assemblies
    The CLR doesn't actually work with modules; it works with assemblies. First, an assembly is a logical grouping of one or more managed modules or resource files. Second, an assembly is the smallest unit of reuse, security, and versioning. Depending on the choice you make with your compilers or tools, you can produce a single-file or a multifile assembly.

3. Loading the Common Language Runtime
    Each assembly that you build can be either an executable application or a DLL containing a set of types(components) for use by an executable application. Of course, the CLR is resposible for manage the execution of code contained within these assemblies.
    when you build an EXE assembly, the compiler/linker emits some special information into the resulting assembly's PE file header and the file's .text section. When the EXE file is invoked, this special information cause the CLR to load and initialize. The CLR then locates the application's entry point method and allows the application to start executing. Similarly, if an unmanaged application calls LoadLibrary to load a managed assembly, the DLL's entry point function knows to load the CLR in order to process the code contained within the assembly.
    for more information, turn to page 20 of this book.

4. Executing your Assembly's Code
    Figure 1-4: Calling a method for the first time (Page 24)
    Figure 1-5: Calling a method for the second time (Page 25)

5. IL and Verfication
    IL is stack-based and IL instructions are typeless.
    While compile the IL into CPU native instructions, the CLR performs a process called verification. Verification examines the high-level IL code and ensure that everything it does is "safe".
    The managed module's metadata includes all the method and type information used by the verification process. If the IL code is determined to be "unsafe", then a System.Security.VerificationException exception is thrown.

6. The .NET Framework Class Library (FCL)
7. The Common Type System (CTS)
    The CLR is all about types. Types expose functionality to your application and components. Types are the mechanism by which code written in one programming language can talk to code written in a different programming language.

8. The Common Language Specification
9. Interoperability with Unmanaged Code
    The CLR supports three interoperability scenarios:
      1>. Managed code can call an unmanaged function in a DLL
      2>. Managed code can use an existing COM component(server)
      3>. Unmanaged code can use a managed type(server)