Amadeus IT Group ASP.NET Interview Questions Answers

Amadeus IT Group Most Frequently Asked Latest ASP.NET Interview Questions Answers

Where Do You Store The Information About The User's Locale?

System.Web.UI.Page.Culture

What Is Difference Between Webconfig.xml & Machineconfig.xml?

Web.config & machine.config both are configuration files.Web.config contains settings specific to an application where as machine.config contains settings to a computer. The Configuration system first searches settings in machine.config file & then looks in application configuration files.Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. There is only Machine.config file on a web server.

How Is The Dll Hell Problem Solved In .net?

Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

What Are The Ways To Deploy An Assembly?

An MSI installer,
a CAB archive and,
XCOPY command.

What Is 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.

What Namespaces Are Necessary To Create A Localized Application?

System.Globalization and,
System.Resources.

What Is The Smallest Unit Of Execution In .net?

An Assembly.

When Should You Call The Garbage Collector In .net?

As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.

Amadeus IT Group Most Frequently Asked Latest ASP.NET Interview Questions Answers
Amadeus IT Group Most Frequently Asked Latest ASP.NET Interview Questions Answers

How Do You Convert A Value-type To A Reference-type?

Use Boxing.

What Happens In Memory When You Box And Unbox A Value-type?

Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

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.

Eg. A Microsoft Word is a Application. When you open a word file, an instance of the Word starts and a process is allocated to this instance which has one thread.

What Is The Difference Between An Exe And A Dll?

You can create an objects 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? Which Is Preferred? Why?

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. (Which is preferred is a disputable point.

What Is The Gac? What Problem Does It Solve?

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies that are to be shared by several applications on the computer. This area is typically the folder under windows or winint in the machine.

All the assemblies that need to be shared across applications need to be done through the Global assembly Cache only. However it is not necessary to install assemblies into the global assembly cache to make them accessible to COM interop or unmanaged code.

There are several ways to deploy an assembly into the global assembly cache

Use an installer designed to work with the global assembly cache. This is the preferred option for installing assemblies into the global assembly cache.
 Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the .NET Framework SDK.
Use Windows Explorer to drag assemblies into the cache.
GAC solves the problem of DLL Hell and DLL versioning. Unlike earlier situations, GAC can hold two assemblies of the same name but different version.
This ensures that the applications which access a particular assembly continue to access the same assembly even if another version of that assembly is installed on that machine.

What Is An Asssembly Qualified Name? Is It A Filename? How Is It Different?

An assembly qualified name isn't the filename of the assembly; it's the internal name of the assembly combined with the assembly version, culture, and public key, thus making it unique.

e.g. (""System.Xml.XmlDocument, System.Xml, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c5 61934e089"").

How Is A Strongly-named Assembly Different From One That Is Not Strongly-named?

Strong names are used to enable the stricter naming requirements associated with shared assemblies. These strong names are created by a .NET utility – sn.exe

Strong names have three goals

 Name uniqueness. Shared assemblies must have names that are globally unique.
Prevent name spoofing. Developers don't want someone else releasing a subsequent version of one of your assemblies and falsely claim it came from you, either by accident or intentionally.
Provide identity on reference. When resolving a reference to an assembly, strong names are used to guarantee the assembly that is loaded came from the expected publisher.
Strong names are implemented using standard public key cryptography. In general, the process works as follows: The author of an assembly generates a key pair (or uses an existing one), signs the file containing the manifest with the private key, and makes the public key available to callers. When references are made to the assembly, the caller records the public key corresponding to the private key used to generate the strong name.

Weak named assemblies are not suitable to be added in GAC and shared. It is essential for an assembly to be strong named.

Strong naming prevents tampering and enables assemblies to be placed in the GAC alongside other assemblies of the same name.

Explain The Importance And Use Of Each, Version, Culture And Publickeytoken For An Assembly.

This three along with name of the assembly provide a strong name or fully qualified name to the assembly. When a assembly 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.

Explain The Differences Between Public, Protected, Private And Internal.

These all are access modifier and they governs the access level. They can be applied to class, methods, fields.

Public: Allows class, methods, fields to be accessible from anywhere i.e. within and outside an assembly.

Private: When applied to field and method allows to be accessible within a class.

Protected: Similar to private but can be accessed by members of derived class also.

Internal: They are public within the assembly i.e. they can be accessed by anyone within an assembly but outside assembly they are not visible.

What Is Difference Between Metadata And Manifest?

Metadata and Manifest forms an integral part of an assembly( dll / exe ) in .net framework . Out of which Metadata is a mandatory component, which as the name suggests gives the details about various components of IL code viz : Methods, properties, fields, class etc.

Essentially Metadata maintains details in form of tables like Methods Metadata tables , Properties Metadata tables, which maintains the list of given type and other details like access specifier , return type etc.

Now Manifest is a part of metadata only, fully called as “manifest metadata tables” , it contains the details of the references needed by the assembly of any other external assembly / type , it could be a custom assembly or standard System namespace.

Now for an assembly that can independently exists and used in the .Net world both the things ( Metadata with Manifest ) are mandatory , so that it can be fully described assembly and can be ported anywhere without any system dependency . Essentially .Net framework can read all assembly related information from assembly itself at runtime.

But for .Net modules , that can’t be used independently , until they are being packaged as a part of an assembly , they don’t contain Manifest but their complete structure is defined by their respective metadata.

How Do Assemblies Find Each Other?

By searching directory paths. There are several factors which can affect the path (such as the AppDomain host, and application configuration files), but for private assemblies the search path is normally the application's directory and its sub-directories. For shared assemblies, the search path is normally same as the private assembly path plus the shared assembly cache.

Post a Comment

Previous Post Next Post