Introduction
I have seen many people posting the questions about what is shared assemblly, What is private assembly, so I thought of bringing it in the articles section so that everyone could be benefitted from it. This article explains a mcuh needed introduction to new comers in .Net
ASSEMBLIES
Assemblies are basically the compiled code in .Net which contains the code in Microsoft Intermediate Langauge and one more thing that assembiles do for us as compared to dlls is they can maintain versioning with the help of the manifest. You dont need to register the assemblies after compiling like we needed in dlls. you can put the assemblies in the bin folder and refer the namespaces from there. In short find the assembly description as : Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
Differences Between Shared and Private Assemblies and how to use them.
Shared and Private Assembly: A private assembly is a assembly that is available to particular applications where they are kept. And cannot be references outside the scope of the folder where they are kept. In contrast, Shared Assemblies are the assemblies that are accessible globally/shared across the machine to all the applications. For using the shared assemblies you need to register the assembly with a strong name in the global assembly cache(GAC) using gacutil.exe. GAC can be found on all the computers with .Net framework installed.
Summary
I think I have covered everything reagarding assemblies in this article. If something is left then do let me know
|
| Author: Simran 08 Jun 2004 | Member Level: Bronze Points : 0 |
I was very confused about this and this article has cleared many of my doubts. Really a nice one. Thanks.
|
| Author: Abhijit Kulkarni 14 Jun 2004 | Member Level: Silver Points : 0 |
Thanks Puneet, article gave me a clear idea of Assembly. But can u elaborate on how compatibility issue is handled by assemblies when an assembly manifest changes. it means when i change a particular shared assembly & register it in GAC, existing clients using older assembly should not crash?
|
| Author: Puneet 14 Jun 2004 | Member Level: Silver Points : 0 |
You may remember that while using VB6.0 the DLL HELL problem was very much on the cards whenever you change anything in your DLL want to register it again. It can be eliminated by using the Assembly manifest version information fields. The old problem was that a client was simply tied to a particular named DLL as in VB6.0. If a new application dll will be replaced with another DLL that another application used, then there was always a possibility that the replaced DLL would not function with the older application until and unless it would contain all those functionalities. The .NET solution to this is that every assembly has version information carried in the manifest, thus the assembly information for a particular application will carry the dependency information for the particular objects used and within this dependency the manifest of the DLL's that form the objects assembly will be identified and the unique version required for the application will be stored in the manifest for the application in the form of Compatibility Version Numbers . This means that when the client starts to run, the relevant assembles are gathered from the GAC and since the GAC can contain different versions of the same assembly, (remember the Strong Name is the unique identifier), not the file name so now the loader can find the exact version needed. Of course this is why the GAC has to have specialist tools to manipulate the files stored since we now have Assembles that have the same name but different versions and different Strong Names. The compatibility version number is in the following form: Each assembly contains a version number in the form of incompat.compat.hotfix. A change in the incompat portion of the version number means that the new version is not compatible with prior versions. A change in the compat portion of the version number means that this is intended to be compatible with prior versions that share the same incompat version number. A change in the hotfix portion of the version number means that, yes, you've made a change, but it should be considered essentially the same bits as the prior version. The .NET common language runtime then uses this information in making binding decisions. Hope this will clear everything about DLL Hell. EnJOY:) Puneet
|
| Author: Brandon Eischeid 19 Jul 2004 | Member Level: Bronze Points : 0 |
Dear Puneet,
Great article! I know this is a somewhat old post but I thought I would ask you a question anyways. I am trying to compile a DLL for the vb files in my asp.net application. I downloaded most of the code in this application and the DLL that is compiled for all the vb files used. However now I need to make changes to these files and recompile the DLL. I get the dll to be recompiled and created properly however version number on the dll does not match the one that I previously downloaded and now the application will not run properly. Do I need to change the version number? If so, do you how I can do this?
I am very new to the .net framework and we are trying to use this application in production and I need to have it completed and ready immediately but I can't get past this problem. Any help would be greatly appreciated.
Thanks,
brandoe1
|
| Author: Murali Tallapaka 07 Aug 2004 | Member Level: Bronze Points : 0 |
I am very happy to see the article while I am searching for the topic Assemblies. The thing is that theorically I am getting all the information about assemblies. I want to create an assembly which can maintain different versions. I would like to know the sequence of steps (practically) I need to do in order to create more than one version in an assembly. And if I create two versions in an assembly also, how do I refer to a particular version? And How to use it? I request anybody to give solution for my question.
|
| Author: Satya Narayan Karmi 20 Nov 2005 | Member Level: Bronze Points : 0 |
Hi,
Difference between private assembly and global assembly does not give a clear idea here. Here it is mentioned " A private assembly is a assembly that is available to particular applications where they are kept. And cannot be references outside the scope of the folder where they are kept."
As you know we can refer a private assembly from other assemblies form .net, how it is private by nature? Is there any other way out to make it private?
Again, how to refer to a global assembly located in the GAC is not elaborately discussed here.
Thanks & Regards, Satya Narayan Karmi
|