Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

How C# determines which assembly to refers

I need to know one thing.
suppose I have one dot net assembly which is shared in Gac and also available as private assembly

Now, if one project has reference the private assembly then how will c# decide which assembly to pick out of two.
2 Solutions
Jens FiedererCommented:
I think the GAC is searched first.  You can get details here: http://www.codecreations.com/site/programming/net-and-c/37-net-c-articles/57-understanding-net-assemblies-and-references/

or use Fusion Log Viewer to see what actually happens in excruciating detail.
Éric MoreauSenior .Net ConsultantCommented:
from http://nerddawg.blogspot.com/2005/11/dll-search-order-during-loading.html:

For managed code dependencies, the Global Assembly Cache always prevails; the local assembly in application directory will not be picked up if there is an existing (or newer with policy) copy in the GAC.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now