02.07.2013 Views

.NET Interview Questions 4 th Edition By Shivprasad ... - A2Z Dotnet

.NET Interview Questions 4 th Edition By Shivprasad ... - A2Z Dotnet

.NET Interview Questions 4 th Edition By Shivprasad ... - A2Z Dotnet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(A) What is Manifest?<br />

Assembly metadata is stored in Manifest. Manifest contains all <strong>th</strong>e metadata needed to do <strong>th</strong>e<br />

following <strong>th</strong>ings (See Figure Manifest View for more details):<br />

• Version of assembly.<br />

• Security identity.<br />

• Scope of <strong>th</strong>e assembly.<br />

• Resolve references to resources and classes.<br />

The assembly manifest can be stored in a PE file ei<strong>th</strong>er (an .exe or) .dll wi<strong>th</strong> Microsoft<br />

intermediate language (MSIL code wi<strong>th</strong> Microsoft intermediate language (MSIL) code or in a<br />

stand-alone PE file, <strong>th</strong>at contains only assembly manifest information.<br />

(B) Where is version information stored of an assembly?<br />

Version information is stored in assembly inside <strong>th</strong>e manifest.<br />

(I) Is versioning applicable to private assemblies?<br />

Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in<br />

<strong>th</strong>eir individual folders. This does not mean versioning is not needed , you can still version it to<br />

have better version control on <strong>th</strong>e project.<br />

(B) What is GAC?<br />

Twist: In what situations will you register .<strong>NET</strong> assembly in GAC?<br />

GAC (Global Assembly Cache) is where all shared .<strong>NET</strong> assembly reside. GAC is used in <strong>th</strong>e<br />

following situations:-<br />

• If <strong>th</strong>e application has to be shared among several application.<br />

• If <strong>th</strong>e assembly has some special security, requirements like only administrators can<br />

remove <strong>th</strong>e assembly. If <strong>th</strong>e assembly is private <strong>th</strong>en a simple delete of assembly<br />

<strong>th</strong>e assembly file will remove <strong>th</strong>e assembly.<br />

Note:- Registering .<strong>NET</strong> assembly in GAC can lead to <strong>th</strong>e old problem of<br />

DLL hell, where COM version was stored in central registry. So GAC<br />

should be used when absolutely necessary.<br />

(I) what is <strong>th</strong>e concept of strong names?<br />

Twist: - How do we generate strong names?<br />

Twist: - What is use <strong>th</strong>e of SN.EXE?<br />

Twist: - How do we apply strong names to assembly?<br />

Twist: - How do you sign an assembly?<br />

Strong name is similar to GUID (It is supposed to be unique in space and time) in COM<br />

components. Strong Name is only needed when we need to deploy assembly in GAC. Strong<br />

Names helps GAC to differentiate between two versions. Strong names use public key

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!