Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace semantic differences

I see most of the types in .NET framework are spread across 3 different namespaces (may be more), one start with Microsoft, other with System and the third with Windows.

For example there is Windows.System.Threading.ThreadPool and System.Threading.ThreadPool.

Is there a clear cut semantic difference on this design?

like image 907
Arctic Avatar asked Sep 25 '13 13:09

Arctic


People also ask

What is namespace in C sharp?

The namespace keyword is used to declare a scope that contains a set of related objects. You can use a namespace to organize code elements and to create globally unique types.

What is namespace in net framework?

Namespaces are used to organize the classes. It helps to control the scope of methods and classes in larger . Net programming projects. In simpler words you can say that it provides a way to keep one set of names(like class names) different from other sets of names.


2 Answers

Microsoft.* namespaces are typically .NET namespaces for features which are specific to Windows, e.g. registry access

System.* namespaces are "normal" .NET system namespaces

Windows.* namespaces are typically part of Windows Runtime aka WinRT (for Windows 8 store apps, Windows Phone 8)

like image 134
Jon Skeet Avatar answered Sep 22 '22 01:09

Jon Skeet


Windows, is for Windows8 family SDK.

System is for common .NET namespases.

Microsoft is for some windows specific OS features.

like image 22
Tigran Avatar answered Sep 19 '22 01:09

Tigran