[Withvinay.com Powered By :- Vinay Sharma] DotNet Basics Page 2

1 view
Skip to first unread message

Vinay Sharma

unread,
Nov 28, 2011, 3:13:17 AM11/28/11
to with...@googlegroups.com

Where is version information stored of an assembly?
Version information is stored in assembly in manifest.
Is versioning applicable to private assemblies?
Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in their individual folders.
What is GAC?
GAC (Global Assembly Cache) is used where shared .NET assembly reside. GAC is used in the following situations

If the application has to be shared among several application
If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly file will remove the assembly.
What is the concept of strong names?
Strong Name is only needed when we need to deploy assembly in GAC. Strong Names helps GAC to differentiate between two versions. Strong names use public key cryptography (PKC) to ensure that no one can spoof it.
How to add and Remove an assembly from GAC?
There are two ways to install .NET assembly in GAC.

Using Microsoft Installer Package
Using Gacutil
What is Delay signing?
During development process you will need strong name keys to be exposed to developer which is not a good practice from security aspect point of view. In such situations you can assign the key later on and during development you can use delay signing.
What is Garbage Collection?
Garbage collection is a CLR feature which automatically manages memory. Programmers forget to release the objects while coding. CLR automatically releases objects when they are no longer in use and referenced. CLR runs on non-deterministic to see the unused objects and cleans them. One side effect of this non-deterministic feature is that we cannot assume an object is destroyed when it goes out of the scope of a function. Therefore, we should not put code into a class destructo to release resources.
Can we force garbage collector to run?
System.GC.Collect() forces garbage collector to run. This is not recommended but can be used if situations arises.
What is Reflection?
All .NET assemblies have metadata information stored about the types defined in modules. This metadata information can be accessed by mechanism called as "Reflection". System.Reflection can be used to browse through the metedata information.
Using reflection you can also dynamically invoke methods using System.Type.Invokemember.
What are different types of JIT?
JIT compiler is a part of the runtime execution environment. In Microsoft .NET there are three types of JIT compilers.

Pre-JIT : Pre-JIT compiles complete source code into native code in a single compilation cycle. This is done at the time of deployment of the application.

Econo-JIT : Econo-JIT compiles only those methods that are called at runtime. However, these compiled methods are removed when they are not required.

Normal-JIT : Normal-JIT compiles only those methods thar are called at runtime. These methods are compiled the first time they are called, and then they are sored in cache. When the same methods are called again, the compiled code from cache is used fo execution.


--
Posted By Vinay Sharma to Withvinay.com Powered By :- Vinay Sharma at 11/28/2011 01:43:00 PM
Reply all
Reply to author
Forward
0 new messages