Mar 8, 2009

.Net Interview Questions | Assembly - Part -1

1. What you mean by Assembly?
Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. All the .NET assemblies contain the definition of types, versioning information for the type, meta-data, and manifest.

2. What is menifest?

Detailed description of the assembly contents. A manifest contains metadata describing the name, resources, types, and version of the assembly as well as dependencies upon other assemblies. The manifest makes an assembly self-describing, easier to deploy, and not bound to a particular system because of storing data in the Windows registry.

3. How many type of assembly are there?
There are two types of Assembly in .NET
• Private Assembly
• Shared Assembly
Private Assembly: These are simple assemblies and being copied with each applications running folder.Dont nned to have strong name.
Shared Assembly: Also named as Strong Named Assemblies are copied to a single location (usually the Global assembly cache). For all calling assemblies within the same application, the same copy of the shared assembly is used from its original location. Hence, shared assemblies are not copied in the private folders of each calling assembly. Each shared assembly has a four part name including its face name, version, public key token and culture information. The public key token and version information makes it almost impossible for two different assemblies with the same name or for two similar assemblies with different version to mix with each other.
An assembly can be a single file or it may consist of the multiple files. In case of multi-file, there is one master module containing the manifest while other assemblies exist as non-manifest modules. A module in .NET is a sub part of a multi-file .NET assembly. Assembly is one of the most interesting and extremely useful areas of .NET architecture along with reflections and attributes.

4. What is GAC? WhereGAC located on machine?
GAC is known as Global Assembly Cache where the shared assembiles are being kept. GAC can be found on a system at \\Assembly ie. C:\Windows\Assembly

5. Can we have two DLL with same name into GAC?
GAC is a Folder that contains DLL that have strong name.We can say that GAC is a very special folder, and it is not possible to place two files with the same name into a Windows folder,But GAC differentiates DLL by strong names and since strong name can not be same hence wwe can put two DLL with same name into GAC. For example SameNameApp.dll and SameNameApp.dll to co-exist in GAC if the first one have version 1.0.0.0 and the second have 1.1.0.0.

.Net Interview Questions | [Assembly]

0 comments:

Post a Comment