Summary

The Common Type System (CTS) defines a set of standard types for .NET languages to implement. A well-defined CTS enables the Common Language Specification (CLS), the set of rules for enabling cross-language programming.

There are several rules to follow when creating a CLS-compliant application. Most of the CLS compliance rules are also part of the C# language specification. In C#, the majority of non–CLS-compliant syntax is flagged as compiler errors rather than as warnings.

The CLS enables types to be written in any compliant language and reused in other CLS-compliant languages. The example in this chapter demonstrated a C# program that encapsulated a JScript object, inherited from a Managed C++ base class, and inherited a Visual Basic.NET ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.