.NET Framework Interview Questions and Answers (547) - Page 11

What's a satellite assembly?

When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
Describe the difference between a Thread and a Process?

A Process is an instance of an running application. And a thread is the Execution stream of the Process. A process can have multiple Thread.
When a process starts a specific memory area is allocated to it. When there is multiple thread in a process, each thread gets a memory for storing the variables in it and plus they can access to the global variables which is common for all the thread.
What is the difference between an EXE and a DLL?

You can create an object of Dll but not of the EXE.
Dll is an In-Process Component whereas EXE is an OUt-Process Component.
Exe is for single use whereas you can use Dll for multiple use.
Exe can be started as standalone where dll cannot be.
What is strong-typing versus weak-typing?

Strong typing implies that the types of variables involved in operations are associated to the variable, checked at compile-time, and require explicit conversion; weak typing implies that they are associated to the value, checked at run-time, and are implicitly converted as required.
How do you generate a strong name?

.NET provides an utility called strong name tool. You can run this toolfrom the VS.NET command prompt to generate a strong name with an option "-k" and providing the strong key file name. i.e. sn- -k < file-name >
What is the difference between a Debug and Release build?

The Debug build is the program compiled with full symbolic debug information and no optimization. The Release build is the program compiled employing optimization and contains no symbolic debug information. These settings can be changed as per need from Project Configuration properties. The release runs faster since it does not have any debug symbols and is optimized.
Explain the importance and use of each, Version, Culture and PublicKeyToken for an assembly.

This three alongwith name of the assembly provide a strong name or fully qualified name to the assembly. When a assebly is referenced with all three.
PublicKeyToken: Each assembly can have a public key embedded in its manifest that identifies the developer. This ensures that once the assembly ships, no one can modify the code or other resources contained in the assembly.

Culture: Specifies which culture the assembly supports

Version: The version number of the assembly.It is of the following form major.minor.build.revision.
How to install a strong named assembly to GAC at command prompt?

We can use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the .NET Framework SDK or Use Windows Explorer to drag assemblies into the cache.

To install a strong-named assembly into the global assembly cache at the command prompt, type the following command:
gacutil I Asembly_name

In this command, assembly_name is the name of the assembly to be installed in the GAC.
What is GAC?

The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to.

Just copy and paste your assembly to the GAC. But assemblies deployed in the global assembly cache must have a strong name. When an assembly is added to the global assembly cache, integrity checks are performed on all files that make up the assembly.
How to create Key Pair?

You can create a key pair using the Strong Name tool (Sn.exe). Key pair files usually have an .snk extension. To create a key pair at the command prompt, type the following command:
sn k

In this command, file name is the name of the output file containing the key pair. The following example creates a key pair called myKey.snk.
sn -k myKey.snk
What do you mean by ActiveX components?

ActiveX control is a special type of COM component that supports a User Interface. Using ActiveX Control in your .Net Project is even easier than using COM component. They are bundled usually in .ocx files.
What is an Assembly in .NET?

When you compile an application, the MSIL code created is stored in an assembly.Assemblies include both executable application files(.exe files)& libraries(.dll extension)for use by other application.

In addition to containing MSIL,assemblies also include met information(i.e. information about the information contained in assembly,also called as meta-data)and optional resources(sound and picture file, etc).The meta information enables assemblies to be fully self-descriptive.You need no other information to use an assembly,meaning you avoid situations such as failing to odd required data to the system registry and so on,which was often a problem when developing with other platforms.
Why HashTable is used?

It is a .NET class that allows an element to be accessed using a unique key. It is mainly used in database programming.
What is the role of compiler?

Compiler translates a high level language into machine language.
What are the elements inside an assembly?

A .NET assembly consists of the following elements,
A Win32 File Header
A CLR file header
CIL code
Type Metadata
An assembly manifest
Optional embedded resources
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories