Common Language Runtime (CLR)
•
C#
applications are compiled to IL, which is executed by the CLR. This section
highlights several features of the CLR. You'll also see how the CLR manages
your application during execution.
•
In many traditional execution environments of
the past, programmers needed to perform a lot
of the low-level work (plumbing) that applications needed to support. For
example, you had to build custom security systems, implement error handling,
and manage memory.
•
The CLR solves many problems of the past by
offering a feature-rich set of plumbing services that all languages can use.
•
If an
application is for .NET, Windows starts up the CLR and passes the application
to the CLR for execution. The
CLR loads the executable assembly, finds the entry point, and begins its execution process.
Common Type System (CTS).
Common Language Specification (CLS).
- Although the CLR understands all types in the CTS, each language targeting the CLR will not implement all types.
- Languages must often be true to their origins and will not lose their features or add new features that aren't compatible with how they are used.
- However, one of the benefits of having a CLR with a CTS that understands IL, and an FCL that supports all languages, is the ability to write code in one language that is consumable by other languages.
- For CLS compliance, you can still use unsigned types within your code so long as you don't expose them in the public interface of your code, where code written in other languages can see.