.NET Framework

The .NET Framework is a service or platform for building, deploying, and running applications. The .NET Framework consists of 2 main parts: common language runtime and class libraries




















What are the features of .NET Platform / .NET Framework?

There are many features provided by .NET Framework which has made .NET popular and reliable in software development and web development industry. Following are features of .NET Platform / .NET Framework.

o Multilanguage Development
C#.NET supports multiple languages. This is definitely one of the biggest advantages of .NET Framework because programmers having ability in their own languages, can use their skills in their languages. Another advantage of Multilanguage is that all are developed under same basic environment.

o Multi-Device Development
Apart from that .NET supports multiple developments. You can create Mobile Application, PDA Application, etc.


o Platform and Processor independence
Generally when you compile a code written in some language, it is converted directly to Native Code i.e. EXE or DLL. In C#.NET execution of programs is done in two processes. First program is converted from language code to IL Code and then from IL Code to Native Code, which makes .NET application to become Platform and Processor independence.

o Automatic memory management
Memory managed is always one of biggest headache of Developers. C#.NET handles memory managed by itself. Under Garbage Collection method, it automatically collects the objects which are no longer needed and removes it from memory.

o Easy Deployment
In many languages, Deployment is one of the tedious tasks. Using C#.NET application becomes easy to deploy. You can create Deployment project easily which helps to deploy application on target machines.

o Distributed Architecture
C#.NET applications have capability to be executed on Distributed Architecture. You can create applications which can be executed on Distributed Architecture.

o Interoperability with Unmanaged code
Because interaction between new and older applications is commonly required, the .NET Framework provides means to access functionality that is implemented in programs that execute outside the .NET environment. So, Interoperability with Unmanaged Code is provided.

o Security
The design is meant to address some of the vulnerabilities, such as buffer overflows, that been exploited by malicious software. Additionally, .NET provides a common security model for all applications.

o Performance and Scalability
As far as Performance and Scalability is concerned, .NET based applications give better performance in terms of memory, device management, etc. You can create Robust Application with full scalability provided by application.

o XML Support
Today XML is used widely for the transportation of data between Client and Server via HTTP because XML works in Text which can be understood by all OS and Hardware. .NET supports writing, manipulating and transforming of XML documents.



What is the common language runtime (CLR)?

o It is the execution engine for .NET Framework applications.
o It is the heart or backbone of the .NET.
o It's is the runtime engine provided by the .NET framework.
o It provides an infrastructure for run programs and allows them to communicate with other parts of the .NET framework.
It provides a number of services, including the following:
o Code loading and execution
o Application memory isolation
o Verification of type safety
o Conversion of IL to native code
o Access to metadata
o Managing memory for managed objects
o Enforcement of code access security
o Exception handling, including cross-language exceptions

What is the common type system (CTS)?
o CTS allow programs written in different programming languages to easily share information.
o A class written in C# should be equivalent to a class written in C#.NET.
o Languages must agree on the meanings of these concepts before they can integrate with one another.
o CTS forms a subset of CLS. This implies that all the rules that apply to CTS apply to CLS also.
o It defines rules that a programming language must follow to ensure that objects written in different programming languages can interact with each other.
o CTS provide cross language integration.
o The common type system supports two general categories of types:
1. Value types
2. Reference types Value types
o Store directly data on stack. In built data type.
Example: dim a as integer
o Reference types
o Store a reference to the value's memory address, and are allocated
on the heap.
o Example: Hello a = new Hello();

What is the Common Language Specification (CLS)?
o CLS includes basic language features needed by almost all the applications.
o It serves as a guide for library writers and compiler writers.
o The Common Language Specification is a subset of the common type system.
o The Common Language Specification is also important to application developers who are writing code that will be used by other developers.

What is an assembly?
o An assembly is the primary building block of a .NET Framework
application.
o An Assembly is a logical DLL.
o It consists of DLLs or executables.
o It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files).
All managed types and resources are marked either as accessible only within their implementation unit or as accessible by code outside that unit.
What are private assemblies and shared assemblies?
o A private assembly is used only by a single application, and is stored in that application's install directory (or a subdirectory therein).
o A shared assembly is one that can be referenced by more than one application.
o In order to share an assembly, the assembly must be explicitly built for this purpose by giving it a cryptographically strong name (referred to as a strong name).
o By contrast, a private assembly name need only be unique within the application that uses it.

What is metadata?
o Metadata stored within the Assembly.
o NET records information about compiled classes as Metadata.
o Metadata means data about data.
o A .NET language compiler will generate the metadata and store this in the assembly.
o On the .NET Platform programs are compiled into .NET PE (Portable Executable) files.
o The header section of every .NET PE file contains a special new section for Metadata.
o Metadata is nothing but a description of every namespace, class, method, property etc. contained within the PE file.
o The CLR uses this metadata to
- Locate classes
- Load classes
- Generate native code
- Provide security

What is .NET Framework Class Library? (FCL)

o In C, <stdio.h>, <conio.h> etc. are header files. We add those header files in our program to use inbuilt functions.
o Same here, the .NET Framework are collection of classes or namespace that can be used to develop applications.
o The class library consists of data classes, XML classes, Web Forms classes and Windows Forms classes, Smart device classes, Input Output classes.
o Other name of FCL is BCL - Base class library.