articles

Home / DeveloperSection / Articles / Difference between Private and Shared Assembly in C#

Difference between Private and Shared Assembly in C#

Difference between Private and Shared Assembly in C#

Anonymous User2152 05-Jul-2021

 Private Assembly : When we build an assembly which can be only used by particular Application, then that assembly will be called as Private Assembly. Private Assembly create the separate copy of assembly with each user application.

Steps : 1.) Create dll file

2.) Create a Console Application

3.) Adding reference of .dll file to console application and call it. 

To know it with more knowledge go to : Create Private Assembly Application in C sharp

Shared Assembly : When we deploy an application which can be used by several apllication, then the Assembly will be known as Shared Assembly. These assembly muwt have Strong Key Name(.snk) file in it and these assembly must associated in Global Assembly Cache(GAC).

While use of shared assembly copy assembly does not created with each application rather than each client application has referenced to the same assembly.

Steps :

1.) Create .dll file.

2.) Creating .snk File

3.) Associate dll file with .snk file.

4.) Adding dll to GAC

5.) Create a Console Application

6.) Adding reference of dll to console application


Updated 05-Jul-2021
I am a content writter !

Leave Comment

Comments

Liked By