Share via


The Assembly Matching Rule

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Assembly Matching Rule allows developers, operators, and administrators to select target classes based on the file name of the assembly.

Note

The Policy Injection Application Block includes matching rule configuration placeholders that provide backward compatibility. The implementation of matching rules is described in the Unity Application Block documentation. For more information, see The Assembly Matching Rule in the Unity Application Block documentation.

Configuration Settings of the Assembly Matching Rule

The following configuration settings are available for the Assembly Matching Rule:

  • Match (String). This can be the name and version; the name, version and culture; or the full assembly name of the assembly excluding the .dll file name extension. It cannot include wildcard characters. The following are some examples:
    • "Contoso.BusinessObjects.Sales"
    • "Contoso.BusinessObjects.Sales, Contoso.BusinessObjects"
    • "Contoso.BusinessObjects.Sales, Contoso.BusinessObjects, Version=1.0.0.0"
    • "Contoso.BusinessObjects.Sales, Contoso.BusinessObjects, Version=1.0.0.0, Culture=neutral"
    • "Contoso.BusinessObjects.Sales, Contoso.BusinessObjects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

The next procedure describes how to configure the Assembly Matching Rule using the Configuration Console or the Visual Studio Configuration Editor.

To configure the Assembly Matching Rule

  1. Right-click the Matching Rules node in the Enterprise Library Configuration Console or Visual Studio Configuration Editor, point to New, and then click Assembly Matching Rule.
  2. In the right pane of the Enterprise Library Configuration Console, or in the Visual Studio Properties window, select the Name property, and then change the default name to the name you want to use for the new matching rule.
  3. Select the AssemblyName property and enter the name and version; the name, version and culture; or the full assembly name excluding the .dll file name extension; of the assembly that you want the rule to select, such as "MyObjects.DataAccess".