A Word on CLS Compliance

Chapter 1, “Introducing the .NET Platform,” stressed the importance of cross-language interoperability in the vision statement of .NET. One key criterion for success in this space is ensuring that types created in one language can be used or extended from another language. This is where the Common Language Specification (CLS) comes into play.

Before delving any deeper, let’s revisit the first rule of the CLS:

CLS Rule 1: CLS rules apply only to those parts of a type that are accessible or visible outside of the defining assembly.

We haven’t talked about visibility yet, but the idea is rather simple. Assemblies contain types, some of which can be exposed to the outside world. A similar observation holds for types in relation ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.