简体   繁体   中英

.NET Execution Engine and BCL (Base Class Library) cooperation

Currently I'm reading a book named C# Pro 7 with .NET and .NET Core written by Andrew Troelsen and Philip Japikse as extra addition to my programming theory. Topic which on this moment is courious for me is collaboration .NET execution engine (mscoree.dll) with .NET base class libraries like for example mscorlib.dll.

Can somebody tell me what is the reason why our solution code is interacting with BCL during the compilation to instruction-set platform?

  1. That comparasion (BCL and mscorlib.dll) is something kinda extra compatibility checking between our code and base class code used methodology? (Checking the name conventions, return type etc.)
  2. Or it just uses construction of the original structure of the class stored in mscrolib.dll and working something similar to the "layout layer" where we can apply our values and then return the output information?

"The CLR will also interact with the types contained within the .NET base class libraries when required" what does 'required' part of this sentece exactly mean? Because once again it's moreover the thing what I would like to understand in correct manner :)

I've just started working through this book. Probably you've already found an answer but for curious others I'll put my two cents.

In order for the compiled code to be run on a platform it should be compiled to platform-specific instructions. But before that the code should be compiled to MSIL file. For the app code this MSIL file is generated every time a change is made and it happens before CLR. For BCL there are already assemblies (MSIL files) existing and in CLR they should be only loaded to the memory. So the runtime engine locates which exact assemblies should be transformed to platform-specific instrcutions and be loaded to the memory.

So

The CLR will also interact with the types contained within the .NET base class libraries when required

that means it'll look which types from BCL are referenced in the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM