C# Language

What is .NET?

NET stands for Network Enabled Technology..NET is a Framework tool which supports many programming languages.
Ex: VB.NET, C#.NET, F#.NET, C++.NET, J#.NET etc

.NET Framework Overview

The .NET Framework is a class of reusable libraries (collection of classes) given by Microsoft to be used in other .Net applications and to develop, build and deploy many types of applications on the Windows platform including the following:

  • Console Applications
  • Windows Forms Applications
  • Windows Presentation Foundation (WPF) Applications
  • Web Applications
  • Web Services
  • Windows Services
  • Services-oriented applications using Windows Communications Foundation (WCF)
  • Workflow-enabled applications using Windows Workflow Foundation(WF)

That primarily runs on the Microsoft Windows operating system.

.net framework

Framework Components

Here are the major components of the .Net framework.

  1. Common Language Runtime (CLR),
  2. Base Class Library (BCL),
  3. Framework Class Library (FCL),
  4. Common Type System (CTS),
  5. Common Language Specification (CLS),

1. What is Base Class Libraries?
Libraries are set of predefined functionalities. Class library means collection of classes and every class contains some predefined functions which are used to write code in .net. Base class libraries are designed by Microsoft. Without BCL we cannot write any code within the .net. So base class libraries as building blocks of programs of .NET.

2. What is CLR? Explain its role?
CLR is the core component of under .NET’s framework which is responsible conversion of MSIL code to native code and then execute of our application.

3. Framework Class Library

The functionality of FCL can be broadly classified into three categories.

  1. Utility Features,
  2. Wrapper Around OS functionality, and
  3. Frameworks

Utility features include different collection classes. For example list, stack, queue, dictionary, etc. It also includes regular expression (regex) classes.

Wrapper around OS functionality includes classes that act as a wrapper to communicate with OS components such as file system, network features, and console application operations.

Frameworks include the technology used to develop ASP.NET web application, Windows Presentation Foundation (WPF), etc.,

4. Common Types System

The common type system is responsible for declaring, using, and managing types in the CLR. They play a vital role in cross-language integration. CTS ensures type safety, high-performance code execution, and defining rules that language must follow. Also, it offers primitive data types (boolean, byte, int32, char, uInt64)

5. Common Language Specification

Common Language Specification (CLS) is a subset of CLR. CLS comes in handy when codes of different programming languages based on the .Net framework are referred to in the same solution. There are many programming languages that have .Net as the background. Example, C#, F#, VB .Net, etc., And every programming language has its own syntax.

How many times code is compiled in .NET?

In .NET code is compiled twice. In first compilation source code is compiled by respective language compiler and an intermediately code is generated known as MSIL. In second compilation MSIL is converted into native code using CLR.

How many languages .NET supports?

.Net supports 60+ programming languages. In 60+ programming languages 9 are designed by Microsoft and remaining are designed by non Microsoft. Microsoft designed programming languages are:
VB.NET,C#.NET,F#.NET,J#.NET,C++.NET, JSCRIPT.NET, Windows Power Shell, Iron Python, Iron Ruby

What is managed code and unmanaged code execution?

Managed code: code for which MSIL is generated after language compiler compilation directly executed by the CLR is known as managed code
Unmanaged code: code that has written before development of .net for which MSIL is not executed by the CLR directly.

What is language interoperability?
Providing code execution support that has been written in other programming language is known as language interoperability.

What is CLS?
CLS is responsible to provide language interoperability

What is CTS?
At the time of compilation all language specific data types are converted into CLR’s data type .This data type system of CLR which is common to all programming languages of .net is known as common type system.

What is Boxing and UN boxing process?
Boxing: Converting a variable value into “Object” type value implicitly.
UN boxing: Converting the “Object” type value into variable explicitly (Using Conversion Methods).

What is role of JIT compiler, Explain?
The “JIT” (Just In Time) compiler is responsible for compiling the “MSIL” code into the “Native code”. The native code is directly understandable by the system hardware.

How many types are available in .net Framework?
The .NET Framework is available in 3 different types:
.NET Framework: This is the general version, required to run .NET applications on Windows operating system.
.NET Mono Framework: This is required to run .NET applications on other operating systems like UNIX, LINUX and Solaris etc.
.NET Compact Framework: This is required to run .NET applications on other devices like PDA (Personal Digital Assistants), Mobile phones and Smart phones.

Explain the purpose of ILDASM.exe tool?
The ildasm.exe parses any .NET Framework .exe or .dll assembly, and shows the information in human –readable format

What is Assembly and Contents of Assemblies?
In .NET, when an application is compiled into a byte code called MSIL. That MSIL code is stored in an assembly. The assembly contents are:
Byte code: the code in MSIL language.
Security Information: Information about the users / user types, who can access the assembly.
Manifest: Information about the assembly, such as identification, name, version, and so on.
Versioning: the version number of an assembly.

What is GAC (Global Assembly Code)?
All the shared assemblies should be saved in the GAC. GAC offers the following advantages.
i) Unique identification of the shared assemblies.
ii) Avoids the DLL hell (replacement of an assembly related to one application, by another application).
iii) Faster accessibility.

Components of CLR?
The CLR contains the following components.
i) Security Manager / Code safety verifier.
ii) JIT Compiler
iii) Memory Manager
iv) Garbage Collector
v) Exception Manager

What is difference between Language and Technology?
Language: It acts as interface (mediator) between the programmer and the system. It offers some rules and regulations for writing the programs. It also offers some library, which is required for writing the programs.
Technology: It is designed for a particular purpose. For example, for development of web related applications, you have a technology called “ASP.NET”. For development of database related applications, you have another technology called “ADO.NET”. But the technology doesn‘t offer any specific rules for writing the programs. But it offers some library.

What is Visual Studio? What are the versions of visual studio?
Visual studio is nothing but the Visual IDE (Integrated development Environment) which is needed to development applications with .net framework. The IDE integrates 3 Features:
i) Editor
ii) Compiler
iii) Interpreter

 

Scroll to top