17) What is NameSpace ?
A namespace is a logical grouping of related classes and types. Every class should have a NameSpace.
- Forms the logical boundary for a Group of classes.
- It is a Collection of names where each name is Unique.
- The namespace must be specified in Project Properties.
- Assemblies are Self-Describing
- It is an Output Unit. It is a unit of deployment and is used for versioning. Assemblies contain MSIL code.
While using shared assemblies, to avoid Assembly being overwritten by a different version of the same assembly, shared assemblies are placed in a special directory subtree of the file system known as the global assembly cache (GAC). Placing shared assemblies can only be done by a special .Net Utilities.
20) Explain the concept of strong names ?
While using shared assemblies, in order to avoid name collisions strong names are used. Strong Names are based on private key cryptography, ie. private assemblies are simply given the same name as their main file name.
21) How to add and remove a assembly from GAC?
To install assembly in Cache, use Gacutil. To run Gacutil, goto "Visual Studio Command Prompt" and type "gacutil -i <assembly_name>", where (assembly_name) is the DLL name of the project. To uninstall assembly, type gacutil –u <assembly name> in Visual Studio Command Prompt.
22) What is Reflection?
Reflection is used to dynamically load a class, create object and invoke methods at runtime. It can also be used to read its own meta data to find assemblies, modules and type information at runtime.
23) What is Delay signing ?
To create a strong named assembly and to make sure that this assembly can used by someone else, we partially build this assembly by providing a Public Key. We write this Public Key in the AssemblyInfo.vb OR .cs file. We also add an attribute by the name <Assembly:AssemblyDelaySignAttribute(true)> to the assembly info file. This makes it sure that when we build the assembly, it would be containing the information only about the public key before we deliver it to our clients. This is a partial strong named assembly that we have created, and hence it is called Delayed Assembly.
24) What are the different type of JIT's ?
Different Types of JIT are
1) Pre-JIT - Complies complete source code into native code at the time of deployment.
2) Econo-JIT - Complies methods that are called at runtime.
3) Normal-JIT - Complies methods that are called at runtime and get stored in cache. Next time when the same method is called, it will be taken from cache.