Thursday, May 27, 2010

Private Assemblies

A private assembly is an assembly that is deployed with an application and is available for the exclusive use of that application. That is, other applications do not share the private assembly. Private assemblies are one of the methods that can be used to create isolated applications. For more information, see About Isolated Applications and Side-by-Side Assemblies.

Private assemblies must be designed to work side-by-side with other versions of the assembly on the system. For more information, see Guidelines for Creating Side-by-side Assemblies.

Private assemblies must be accompanied by an assembly manifest. Note that name restrictions apply when packaging a DLL as a private assembly to accommodate the way in which Windows searches for private assemblies. When searching for private assemblies, the recommended method is to include the assembly manifest in the DLL as a resource. In this case, the resource ID must equal 1 and the name of the private assembly may be the same as the name of the DLL. For example, if the name of the DLL is MICROSOFT.WINDOWS.MYSAMPLE.DLL, the value of the name attribute used in the assemblyIdentity element of the manifest may also be Microsoft.Windows.mysample. An alternate method of searching for private assemblies is to provide the assembly manifest in a separate file. In this case, the name of the assembly and its manifest must be different than the name of the DLL. For example, Microsoft.Windows.mysampleAsm, Microsoft.Windows.mysampleAsm.manifest, and Microsoft.Windows.mysample.dll. For more information about how side-by-side searches for private assemblies see Assembly Searching Sequence.

Static Assemblies v/s Dynamic Assemlies Tips

Static Assembly
- Stored on disc in PE files
- contains .NET Framework types (interfaces and classes) as
well as resources for the assembly (bitmaps, JPEG files,
resource files, and so on)

Dynamic Assembly
- Not saved on disc before execution and run directly from memory but can be saved on disc after execution


What else please make comments

Assembly Manifest Definition Tips

-A Data Structure responsible to store inforamtion about assembly i.e. metadata.
-metadata contain various information like: assembly's version, security identity and other metadata needed to define the scope of assembly and resolve references to resources and classes.
- can be stored in a PE file (DLL/EXE) with Microsoft Intermediate Language (MSIL) or in standalone PE file that contains only assembly manifest information.
-contains a collection of data that describes how the elements in the assembly relate to each other