Showing posts with label assembly. Show all posts
Showing posts with label assembly. Show all posts

Saturday, November 19, 2011

.Net Interview questions: - What is GAC, add/remove an assembly from GAC and how do we make choices between 2 versions of the same assembly?

This .NET interview questions will make you remember the basics of .NET if you are senior person in the .NET industry. For the fresher it is still a hiccup so one can start answering the same as follows: -

About GAC: -

GAC (Global Assembly Cache) is where all shared .NET assembly resides. GAC is used in the following situations: -
  • If the application has to be shared among several application which is in the same computer.
  • 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 the assembly file will remove the assembly.
Add/remove an assembly from GAC: -

You can use the ‘GACUTIL’ tool which comes with visual studio. So to register an assembly in to GAC go to “Visual Studio Command Prompt” and type “gacutil –i (assembly name)”, where (assembly name) is the DLL name of the project.

One you have installed the assembly the DLL can be seen in ‘c:\windows\assembly\’ folder.

When we have many DLL’s to be deployed we need to create setup and deployment package using windows installer. So the common way of deploying GAC DLL in production is by using windows installer.

Making choice between two versions of the same assembly in GAC: -

When we have two version of the same assembly in GAC we need to use binding redirect tag and specify the version we want to use in the new version property as shown in the below “app.config” file.




Get ready to see more basics videos of .NET interview questions on Garbage Collector, Gen 0, 1 & 2 as follows: -



Get more fundamentals stuffs on interview questions and answers for .NET
Regards,

More from author’s blogs on Most asked Dotnet interview question for interview references.

Friday, July 1, 2011

.NET and C# interview questions:Show how do we view an assembly in .NET?

Answer:

When coming to understand the internals, nothing can beat ILDASM. ILDASM converts the whole ‘exe’ or ‘dll’ in to IL code. To run ILDASM you have to go to ‘C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin’. Note that we had v1.1 you have to probably change it depending on the type of framework version you have.
If you run IDASM.EXE from the path you will be popped with the IDASM exe
program as shown in figure. Click on file and browse to the respective
directory for the DLL whose assembly you want to view. After you select the
DLL you will be popped with a tree view details of the DLL as shown in
figure ILDASM. On double clicking on manifest, you will be able to view
details of assembly, internal IL code etc as shown in the figure.

Note: - The version number are in the manifest itself which is defined with
the DLL or EXE thus making deployment much easier as compared to COM where
the information was stored in registry. Note the version information in Figure
Manifest view.
You can expand the tree for detail information regarding the DLL like methods, properties, functions etc.


And once you open the Manifest you will be able to see the inner details as shown in the following picture: -



Following is the video which shows that how the questions are asked C#
and .NET interviews.




Please click here to see more interview questions and answers for .NET

Regards,

Visit Authors blog for more Most asked Dotnet interview questions

Tuesday, May 24, 2011

.NET and ASP.NET interview Question :- Elaborate different types of assemblies?

In .NET there are basically three different types of assemblies as follows.
1.Private assemblies:-A private assembly is normally used by a single application and is stored in the application's directory.
2.Public/shared assemblies:- A shared assembly is normally stored in the global assembly cache which is a repository of assemblies maintained by the .NET runtime.
3.satellite assemblies:-Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language.
You will be also interested in watching the below video, which are also asked in most of the interviews and favorable question of interviewers.



Please click here to see more .NET/ Asp.Net interview questions

Regards,

Visit Authors blog for more .NET / Asp.Net interview questions