Custom Version Policies

.NET allows administrators to override the default assembly-resolving policy and provide a custom version-binding policy. Administrators can provide custom policies for individual applications that affect only the way a particular application binds to its private or shared assemblies. They can also provide machine-wide custom policies that affect the way every application on the machine binds to specific shared assemblies in the GAC. Administrators can choose to create custom policies for any reason, but typically they do so when a new and improved version of a server assembly is available and the server assembly vendor guarantees backward compatibility with the older version. The administrator in that case would like to take advantage of the new version; however, .NET’s default version-binding and resolving policy always tries to load the exact version with which the client application was compiled. If the new version overrides a strongly named private copy of the older version, the assembly resolver will throw an exception when it fails to find the old version. Even when the new version is installed in the GAC, the resolver will ignore it and continue to load the older version. To deal with these situations, .NET allows administrators to redirect from the requested version to a different version. .NET also allows administrators to specify a particular location to look for a specific version, instead of the default location (first the GAC, then the application ...

Get Programming .NET Components, 2nd Edition 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.