Assembly Binding

So far we have learned that assembly bindings can be redirected using either the application configuration file, the machine configuration file, or the publisher policy. In addition, a referenced assembly can be located in either the GAC, the application local directory, or any of its subdirectories as dictated by the privatePath entry in the configuration file. This complexity makes you wonder if there is any order that the assembly resolver follows to bind to an assembly. Adding to this complexity is the fact that an assembly can automatically be downloaded and installed based on the codeBase entry in the configuration file. Fortunately, there is a method to the madness.

Let's first recap how an assembly gets loaded in an application. ...

Get .NET Programming: A Practical Guide Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.