Wednesday, October 31, 2007
What is the difference between private and shared assembly?
Shared Assemblies are the assemblies that are accessible globally/shared across the machine to all the applications. For using the shared assemblies you need to register the assembly with a strong name in the global assembly cache(GAC).
What is reference type and value type?
Value type inherit from System.ValueType which inturn inherits from System.Object.They are stored in stack.Eg. Structs, integer,bool etc
What is boxing and unboxing?
Eg.
int i = 123;
object o = (object)i; // boxing
o = 123;
i = (int)o; // unboxing
What is Base Class Library?
What is menifest?
It contains:
Assembly name: A text string specifying the assembly's name.
Version number: A major and minor version number, and a revision and build number. The common language runtime uses these numbers to enforce version policy.
Culture: Information on the culture or language the assembly supports. This information should be used only to designate an assembly as a satellite assembly containing culture- or language-specific information. (An assembly with culture information is automatically assumed to be a satellite assembly.)
Strong name information: The public key from the publisher if the assembly has been given a strong name.
List of all files in the assembly: A hash of each file contained in the assembly and a file name. Note that all files that make up the assembly must be in the same directory as the file containing the assembly manifest.
Type reference information: Information used by the runtime to map a type reference to the file that contains its declaration and implementation. This is used for types that are exported from the assembly.
Information on referenced assemblies: A list of other assemblies that are statically referenced by the assembly. Each reference includes the dependent assembly's name, assembly metadata (version, culture, operating system, and so on), and public key, if the assembly is strong named.
What is the difference between a namespace and assembly name?
An assembly is the building block of a .NET application. It is a self describing collection of code, resources, and metadata (data about data, example, name, size, version of a file is metadata about that file).
One assembly can contain many namespaces.
What is managed code and managed data?
Data whoes memory allocation and deallocation is managed by Garbage collector is called as managed data.
What is Common Language Specification (CLS)?
Its a subset of Common Type System.
What is "Common Type System" (CTS)?
Because all data types from all languages are mapped to common .net datatypes we can integrate code written in different .net languages into one assembly.
What is "Microsoft Intermediate Language" (MSIL)?
All .NET programming language first gets compiled into intermediate language(MSIL) and then CLR compiles IL code into natice code.
MSIL is the CPU-independent instruction set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects.Combined with metadata and the common type system, MSIL allows for true cross- language integration.
What is CLR?
Common Language Runtime (CLR) manages the execution of code and provides different services like Garbage collection and support for Base Class Libraries etc. The main constituents of CLR are:
The common Language Runtime (CLR) a rich set of features for cross-language development and deployment. CLR supports both Object Oriented Languages as well as procedural languages. CLR provides security, garbage collection, cross language exception handling, cross language inheritance and so on.
The Common Type System, support both Object Oriented Programming languages as well as procedural languages. Basically CTS provides rich type system that is intended to support wide range of languages.
CLS (Common Language Specification) defines a subset of Common Type System, which all language compilers targeting CLR must adhere to. CLS is a subset of CTS.