The Role of the Common Language Specification

The CLS defines a subset of the CTS, limiting it to types that can be understood by any .NET language on the platform. It accomplishes this by defining a set of rules that type definitions need to satisfy.

Without a doubt, the first CLS rule is the most important one because it reduces the workload imposed on .NET developers to keep their types CLS-compliant:

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

This rule should cause a “D’oh” effect for everyone reading it. Because the CLS is about cross-language interoperability, only things that are visible to the outside world matter. Or string the reverse: Internal implementation ...

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

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