.Net Framework Interview Questions Answers
What is .Net Framework?
The .NET is a Framework, which is a collection of classes of reusable libraries given by Microsoft to be used in other .NET applications and to develop, build and deploy any types of applications.
What is CTS?
What is GAC?
What is CLR?
The CLR stands for Common Language Runtime and it is an Execution Environment. It works as a layer between Operating Systems and the applications written in .NET languages.
The main function of CLR (Common Language Runtime) is to convert the Managed Code into native code and then execute the program.
CLR runtime engine comes with set of services.
- Assembly Resolver
- Assembly Loader
- Type Checker
- COM marshalled
- Debug Manager
- Thread Support
- IL to Native compiler
- Exception Manager
- Garbage Collector
How many type of assembly we have in .net?
Private assembly, Shared assembly & Satellite Assembly.
Private assemblies are not designed to be shared. They are designed to be used by one application and must reside in that application's directory or subdirectory. This isolated methodology is nostalgically reminiscent of the DOS days when applications were fully contained within their own directories and did not disturb one another. By default, all assemblies (like the one we created in the previous example) are private. If you wish to make them shared, you must explicitly do so by signing them, as the upcoming example will illustrate. It is expected that the majority of assemblies you create will be of the private type.
For those components that must be distributed, Microsoft offers the shared assembly. The shared assembly concept is centered around two principles. The first, called side-by-side execution, allows the CLR to house multiple versions of the same component on a single machine. The second, termed binding, ensures that clients obtain the version of the component they expect. Together, these two principles free developers from having to ensure that their components are compatible with earlier versions. If a component evolves through versions 1.0, 1.1, and 2.0, the CLR will maintain separate copies of each version and invoke the correct one accordingly.
A satellite assembly is defined as an assembly with resources only, no executable code.
What is strong name & how to create a strong name?
Open command prompt go to Dll folder path.
- 1. Type sn -k HP.snk
- 2. This create HP.snk file in E:\hemant\practice\HP\bin\Debug folder.
- 3. Open the AssemblyInfo.cs file of project.
- 4. Type path of snk file in strongname key attribue.