.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

What are private assemblies and shared assemblies?

Posted By :Shashi Ray     Posted Date :September 30, 2008    Points :10   Category :.NET Framework 
A private assembly is used only by a single application, and is stored in that application's install directory (or a subdirectory therein). A shared assembly is one that can be referenced by more than one application. In order to share an assembly, the assembly must be explicitly built for this purpose by giving it a cryptographically strong name (referred to as a shared name). By contrast, a private assembly name need only be unique within the application that uses it.
By making a distinction between private and shared assemblies, we introduce the notion of sharing as an explicit decision. Simply by deploying private assemblies to an application directory, you can guarantee that that application will run only with the bits it was built and deployed with. References to private assemblies will only be resolved locally to the private application directory.
There are several reasons you may elect to build and use shared assemblies, such as the ability to express version policy. The fact that shared assemblies have a cryptographically strong name means that only the author of the assembly has the key to produce a new version of that assembly. Thus, if you make a policy statement that says you want to accept a new version of an assembly, you can have some confidence that version updates will be controlled and verified by the author. Otherwise, you don't have to accept them.
For locally installed applications, a shared assembly is typically explicitly installed into the global assembly cache (a local cache of assemblies maintained by the .NET Framework). Key to the version management features of the .NET Framework is that downloaded code does not affect the execution of locally installed applications. Downloaded code is put in a special download cache and is not globally available on the machine even if some of the downloaded components are built as shared assemblies.
The classes that ship with the .NET Framework are all built as shared assemblies.

You can also find related Interview Question to What are private assemblies and shared assemblies?  below: 

What are private and shared assemblies?

  
A private assembly resides within the directory of the application, it can be used only by the application.
A shared assebly is stored in the global assebly cache (GAC), which is the repository of asseblies maintained at runtime, a shared assembly can be referenced by more than one application. (More...)

Where are shared assemblies stored in .NET?

  
Shared Assemblies are stored in Global Assembly Cache also known as GAC. (More...)

Is versioning applicable to private assemblies?

  
Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in their individual folders. (More...)

What is Public or shared assemblies ?

  
These are static assemblies that must have a unique shared name and can be used by any application.
An application uses a private assembly by referring to the assembly using a static path or through an XML-based application configuration file. While the CLR doesn't enforce versioning policies-checking whether the correct version is used-for private assemblies, it ensures that an
application uses the correct shared assemblies with which the application was built. Thus, an application uses a specific shared assembly by referring to the specific shared assembly, and the CLR ensures that the correct version is loaded at runtime.
(More...)

Is versioning applicable to private assemblies?

  
Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in
their individual folders. (More...)

Is versioning applicable to private assemblies?

  
No, versioning is not applicable to private assemblies as these assemblies reside in their individual folder.
Versioning is applicable only to globsl assebly cache (GAC), i.e only to Shared/Public assemblies (More...)

where Shared Assemblies stored?

  
The shared assemblies are stored in Global assembly cache. (More...)

Is versioning applicable to private assemblies?

  
Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in their individual folders. (More...)

Can you have two assemblies with the same name in GAC?

  
Yes you can have two or more assemblies having same name in GAC only when assemblies version no is different.As we know that all assemblies in .NET is having version no. (More...)

What is Satellite Assemblies in .NET?

  
Assemblies which contains culture information are known as satellite assemblies. Satellite assembly is used to get language specific resources for an application. (More...)

How can I see what assemblies are installed in the global assembly cache?

  
The .NET Framework ships with a Windows shell extension for viewing the assembly cache. Navigating to % windir%\assembly with the Windows Explorer activates the viewer. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend