C# and .NET interview questions and answers around global assembly cache (GAC)

C# and .NET interview questions and answers

One of the most asked questions in .NET interviews are around assembly and GAC. Most of the times .NET developers get confused with these questions. Below are some of the question which keeps coming from GAC perspective.

Interviewer normally starts with what is GAC?

GAC is a central repository folder where you can share your DLL among different applications running in the same computer. So for example you have accounting and invoicing application running in the same computer and both these application need some common utility like the logging DLL then you need to register them in GAC and share them.

If you are able to answer the top interview questions the next question can be on versioning.

If we have different versions of DLL in GAC how can the application identify them?

This is done by using binding redirect and specifying older version and new version value. So which ever version you put in the new version will be used by the application.

The other question can come from the perspective of how you can register a DLL in GAC. Interviewer expectation is that you do not just talk about GACUTIL but you need talk more realistic.

What are the various ways by which you can register a DLL in GAC?

We can use the GACUTIL tool to register the DLL in GAC.

But when we talk about application they have 100 of DLL’s so how feasible is GACUTIL tool?

We need to create installation package which will register the DLL in GAC.

If we do not have strong name can assembly be registered in GAC?

This is again a catchy question which is testing do you know the pre-requisites to register DLL in GAC. No, you cannot register DLL in GAC without strong names.

How do we create strong named DLL?

By using SN.EXE or by going to the project properties and making the assembly string named.

So next time you face a question in GAC in C# and .NET interviews understand the above twist and twirls. Happy job hunting.

C# and Dotnet interview questions and answers


About c# and .NET Interview questions

This blog is for developers who want to crack .NET and C# interviews. It has all tips and tricks needed to crack .NET interviews , C# interview , SQL Server interview , Java interview , WCF Interview , Silverlight interview , WPF interview , LINQ interview , Entity framework Interview. Do not forget to watch our Learn step by step video series. Learn MVC in 16 hours:- https://www.youtube.com/watch?v=Lp7nSImO5vk Learn AngularJS Step by Step:- https://www.youtube.com/watch?v=0kmdjqgO9IY Learn Design Pattern in 8 hours:- https://www.youtube.com/watch?v=YDobmucohqk Learn C# and .NET in 60 days:- https://www.youtube.com/watch?v=yh2SrzCkNQA Learn MSBI in 32 hours:- https://www.youtube.com/watch?v=mGPJx3ocFgg Learn SharePoint Step by Step in 8 hours:- https://youtu.be/C2fW76SwJNU
This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s