Top Dot Net Interview Questions With Answers Part 1
1. What is a IL?
- (IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language).
- All .NET source code is compiled to IL.
- This IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In- Time (JIT) compiler.
2. What is a CLR?
- Full form of CLR is Common Language Runtime.
- It forms the heart of the .NET framework.
- All Languages have runtime.
- It is the responsibility of the runtime to take care of the code execution of the program.
3. What is a CTS?
- In order that two language communicate smoothly CLR has CTS (Common Type System).
4. What is a CLS (Common Language Specification)?
- This is a subset of the CTS which, all .NET languages are expected to support.
- It was always a dream of Microsoft to unite all different languages in to one umbrella.
- CLS is one step towards that.
- Microsoft has defined CLS as a guideline that languages to communicate with other .NET languages, in a seamless manner.
5. What is a Managed Code?
- Managed code runs inside the environment of CLR i.e. .NET runtime.
- In short, all IL are managed code.
- But the third-party software such as VB6 or VC++ component are unmanaged code as .NET runtime (CLR) does not have control over the source code execution of the language.
6. What is an Assembly?
- Assembly is unit of deployment like EXE or a DLL.
- An assembly consists of one or more files (dlls, exe’s, html files etc.).
- It represents a group of resources, type definitions, and implementations of those types.
7. What are different types of Assembly?
- Two types of assembly are Private and Public assembly.
- A private assembly is normally used by a single application.
- It is stored in the application's directory, or a sub-directory beneath.
- A shared assembly is normally stored in the global assembly cache (GAC).
- The GAC is a repository of assemblies maintained by the .NET runtime.
- Shared assemblies are usually libraries of code which many applications will find useful, e.g. Crystal report classes are used by all application for Report Preparation.
8. What is NameSpace?
- Namespace provides a "named space" for easy organization of the application.
- NameSpace logically group types. Example System.Web.UI logically groups our UI related features.
- In Object Oriented world may times it is possible that programmers will use the same class name.
- By qualifying NameSpace with classname this collision can be removed.
9. What is the difference between NameSpace and Assembly?
- Assembly - physical grouping of logical units.
- Namespace - logical groups of classes.
- Namespace can span multiple assembly.
10. What is Manifest?
- Assembly metadata is stored in Manifest.
- The metadata includes:
- Version of assembly
- Security identity
- Scope of the assembly
- Resolve references to resources and classes.
- The assembly manifest can be stored in a Project Executable file format (an .exe or .dll).
- It is in the form of a Microsoft intermediate language (MSIL) code or a stand-alone PE file that contains only assembly manifest information.