Difference between Private and Public and Gloabl Assemblies..

Posted by Nagasundar_Tn under C# on 11/11/2012 | Points: 10 | Views : 3798 | Status : [Member] | Replies : 4
I would like to know what is the difference between public and private and assemblies in GAC (global assembly cache). Specifically I would like to know the difference between public assembly and assemblies in Gloabl assembly cache..

Regards,
T.N.Nagasundar



Responses

Posted by: Saratvaddilli on: 11/11/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
An assembly is the basic building block in .NET. It is the compiled format of a class, that contains Metadata, Manisfest & Intermediate Language code.

An assembly may be either Public or Private. A public assembly means the same as Shared Assembly.

Private Assembly - 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 assembly.

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.

A Strong Name assembly is an assembly that has its own identity, through its version and uniqueness.
kindly go through this link once
http://srikanthtechnologies.com/articles/dotnet/globalassembly.html

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Nagasundar_Tn, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nagasundar_Tn on: 11/12/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks for your link. Can Shared assembly be created without putting in GAC? Are there any other ways to create Shared assemblies?

Regards,
T.N.Nagasundar

Nagasundar_Tn, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saratvaddilli on: 11/12/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
As per my knowledge
shared assembly should be created with in the global assembly cache by using Global Assembly Cache utility tool called gacutil .

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Nagasundar_Tn, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Funda on: 11/14/2012 [Member] Starter | Points: 25

Up
0
Down
YES U CAN AND U SHOULD NOT USE GAC for SHARED ASSEMBLY for few Seens...
--------------------------------------------------------------------------------------------------------------
* Some of the assemblies referenced other third-party, closed-source assemblies which were not signed with a strong name. -
In order to add any assembly to the GAC, the assembly itself AND all assemblies it references must be signed. Unless you have access to the source of these third party assembly, there is no way to sign it.

* The project and the shared code in your assemblies will be constantly being developed by a team of developers -
It's advisable that your development platforms mirror the set-up of your live server. If you plan on putting your shared assemblies in the GAC on the live server, then ideally they will also be in the GAC on your development platforms. If you have a team of developers working on a shared code library, it would get extremely difficult and time consuming to make sure every developer has the correct version of the code in their GAC. In our case, the shared code library wouldn't be incremented in versions but rather always have a single current version.

Nagasundar_Tn, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response