An Assembly is a basic building block of .Net Framework applications. It is basically a compiled code that can be executed by the CLR. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An Assembly can be a DLL or exe depending upon the project that we choose.
Assemblies are basically the following two types.
- Private Assembly
- Shared Assembly
Private Assembly
It is an assembly that is being used by a single application only. Suppose we have a project in which we refer to a DLL so when we build that project that DLL will be copied to the bin folder of our project. That DLL becomes a private assembly within our project. Generally, the DLLs that are meant for a specific project are private assemblies.
Shared Assembly
Assemblies that can be used in more than one project are known to be a shared assembly. Shared assemblies are generally installed in the GAC. Assemblies that are installed in the GAC are made available to all the .Net applications on that machine.
However, there are two more types of assemblies in .Net, Satellite Assembly, and Shared Assembly.
GAC
GAC stands for Global Assembly Cache. It is a memory that is used to store the assemblies that are meant to be used by various applications.
Every computer that has CLR installed must have a GAC. GAC is a location that can be seen at “C:\Windows\assembly” for .Net applications with frameworks up to 3.5. For higher frameworks like 4 and 4.5, the GAC can be seen as:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL.
Installing an assembly into the GAC
For installing an assembly into the GAC we first need to generate strong names for the assembly because only a strong name assembly is installed in the GAC. All other assemblies are known as weak named assemblies and they cannot be stored in the GAC.
To generate a strong name assembly we first create a console application type project. In that solution, we will add one more project (Class Library).

In the Class Library project, I created a class Student that contains a method that returns a string. Now I will add a reference of the Class Library to my Console application project and will use this method.
If we see the bin folder of our Console Application project then we will see that the ClassLibrary DLL is present there (It will come when we build our project). This DLL is a Private Assembly now.








Uzair AhmedPosted Sep 22, 2022, 8:05 AM
Why we need to add an assembly in GAC? please explain.
naga rajanPosted Jul 3, 2019, 5:41 AM
It is very nice and useful.Can you explain where we use the GAC
naga rajanPosted Jul 3, 2019, 5:40 AM
It very nice and useful.
kiran kadamPosted Nov 21, 2014, 4:31 AM
can you explain metadata and manifest
Ritesh SharmaPosted Apr 21, 2014, 8:59 PM
Yes sam that will also act like a shared assembly. I have written one more article over that. You can find that http://www.c-sharpcorner.com/Blogs/15206/how-to-use-deployed-assembly-in-gac-or-assembly-resolution.aspx but installing the assembly in GAC will solve the problem of DLL hell in which we can have different versions of assembly installed at same time.
Sam HobbsPosted Apr 21, 2014, 5:56 PM
What if we put a DLL in a folder and put the folder name in the path environment variable and the DLL is used by many applications, is the DLL shared or private?