Please enable Javascript to correctly display the contents on Dot Net Tricks!

Understanding Relationship Between CTS and CLS

  Authors : Shailendra Chauhan
Updated On : 26 Sep 2016
Total Views : 156,693   

CTS and CLS are parts of .NET CLR and are responsible for type safety with in the code. Both allow cross language communication and type safety. In this article I would like to expose the relationship between these two.


CTS stands for Common Type System. It defines the rules which Common Language Runtime follows when declaring, using, and managing types. The common type system performs the following functions:

  1. It enables cross-language integration, type safety, and high-performance code execution.

  2. It provides an object-oriented model for implementation of many programming languages.

  3. It defines rules that every language must follow which runs under .NET framework. It ensures that objects written in different .NET Languages like C#, VB.NET, F# etc. can interact with each other.

normal jiit


CLS stands for Common Language Specification and it is a subset of CTS. It defines a set of rules and restrictions that every language must follow which runs under .NET framework. The languages which follows these set of rules are said to be CLS Compliant. In simple words, CLS enables cross-language integration.

For example, one rule is that you cannot use multiple inheritance within .NET Framework. As you know C++ supports multiple inheritance but; when you will try to use that C++ code within C#, it is not possible because C# doesn’t supports multiple inheritance.

One another rule is that you cannot have members with same name with case difference only i.e. you cannot have add() and Add() methods. This easily works in C# because it is case-sensitive but when you will try to use that C# code in VB.NET, it is not possible because VB.NET is not case-sensitive.

Why CTS is Called Common Type System?

In .NET, every Data Type is internally represented by a class or structure. All the classes and structures related to Data Types are collectively known as CTS. As you know every language provides its own keywords for Data Types but internally all the languages which run under .NET framework use the classes and structures available in CTS.

For example, C# has int Data Type and VB.Net has Integer Data Type. Hence a variable declared as int in C# or Integer in, finally after compilation, use the same structure Int32 from CTS.

All the structures and classes available in CTS are common for all .NET Languages and purpose of these is to support language independence in .NET. Hence it is called CTS.

What do you think?

I hope, you have enjoyed the article about CTS and CLS. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

Free Interview Books
13 NOV
MEAN Stack Development (offline)

Sat, Sun (11:00 AM-12:30 PM IST)

Know More
PPC Marketing (offline)

Sat, Sun 09:00 AM-10:30 AM IST

Know More
ASP.NET MVC with AngularJS Development (offline)

SAT,SUN 08:00 AM-09:30 AM

Know More
Spoken English & Personality Development (offline)

Sat,Sun 05:00 PM-06:30 PM IST

Know More
NodeJS Development (online)

MON-FRI 06:00 AM - 07:30 AM IST

Know More
AngularJS Development (online)

MON-FRI 08:00 PM-09:30 PM IST.

Know More
27 OCT
ASP.NET MVC with AngularJS Development (online)

MON-FRI     07:30 AM-09:00 AM IST

26 OCT
ASP.NET MVC with AngularJS Development (online)

Mon-Fri     07:30 AM-09:00 AM IST

25 OCT
.NET Development (offline)

Mon-Fri     9:00 AM-11:00 AM IST

24 OCT
MEAN Stack Development (online)

MON-FRI     06:00 AM -07:30 AM IST

12 OCT
ASP.NET MVC with AngularJS Development (online)

Mon-Fri     09:30 PM-11:00 PM IST

17 SEP
ASP.NET MVC with AngularJS Development (online)

Sat, Sun     03:00 PM-05:00 PM IST

17 SEP
ASP.NET MVC with AngularJS Development (offline)

SAT,SUN     05:00 PM-06:30 PM IST

NodeJS Development (offline)

Sat, Sun     11:00 AM-12:30 PM IST

24 JUL
PPC Marketing (offline)

Sat,Sun     03:00 PM-05:00 PM


Professional Speaks