Private And Shared Assembly in .Net
In this blog, I’m trying to explain the private and shared
assembly and differences between them.
This type of assembly is used by
a single application. It is stored in the application's directory or the
applications sub-directory. There is no version constraint in a private
Shared Assembly or Public Assembly
A shared assembly has version constraint. It
is stored in the Global Assembly Cache (GAC). GAC is a repository of shared
assemblies maintained by the .NET runtime. It is located at C:\Windows\Assembly
OR C:\Winnt\Assembly. The shared assemblies may be used by many applications.
To make an assembly a shared assembly, it has to be strongly named. In order to
share an assembly with many applications, it must have a strong name.
Differences between Private and Shared Assembly
assembly can be used by only one application.
assembly can be used by multiple applications
assembly will be stored in the specific application's directory or
assembly is stored in GAC (Global Assembly Cache).
is no other name for private assembly.
assembly is also termed as shared assembly
name is not required for private assembly.
name has to be created for shared assembly.
assembly doesn't have any version constraint.
assembly should strictly enforce version constraint.