Assembly Location

To understand where assemblies are located, you must consider that they are generally divided into private assemblies and shared assemblies. Private assemblies are standalone assemblies or assemblies that reside exclusively in the same folder of the application that holds a reference. This is a common scenario, because it makes the deployment easier because you just need to distribute the content of the application folder (known as XCopy mode). Every application holding a reference to a private assembly needs to have a copy of the assembly inside its folder. This means that if you have ten applications referencing the assembly, you will also have ten copies of the assembly. Shared assemblies are instead files with a digital signature that can be installed to a particular location known as the Global Assembly Cache that allows having a single shared copy of the assembly only if this comes from a trusted publisher. The Global Assembly Cache is an important topic that Chapter 53, “Understanding the Global Assembly Cache,” addresses, so read it for further details.

Binding, Codebase, Probing

When one assembly is referenced by another one, the .NET runtime needs to link them. This process is known as binding and is performed based on the assembly version, culture information, and strong name if available. When the runtime resolves binding, it searches for the physical assembly. This search process is known as probing. Because a signed assembly has also signature information that is kept when you add a reference, search is first performed in the GAC. If the assembly is not found there, the runtime searches for it looping through the application folder and subfolders until it’s found. If you plan to place assemblies to locations different from the GAC and the application folder, you can place a codeBase suggestion in the application configuration file to tell the runtime where the required assembly will be found.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.100.20