Partager via


Creating Custom Providers for Enterprise Library

Enterprise Library incorporates an easy-to-use extensible mechanism for you to add your own custom providers if you require specialized behavior. You can plug in custom providers that you create without needing to recompile Enterprise Library.

In addition, the configuration mechanism makes it easy to add a full design-time experience to your custom providers so that they can be configured within the configuration tools in exactly the same way as the built-in providers. The configuration tools are metadata driven, and read information about available providers and extensions from assemblies located in their run-time folder on startup. This means that you do not need to recompile the configuration tool to add a design-time experience for your custom providers.

The following topics describe the general process for creating a custom provider for Enterprise Library, and include an example of a simple provider:

  • Enterprise Library Extension Points. This topic lists the extension points for Enterprise Library, and the classes you can use when creating a custom provider and specifying configuration information for it.
  • Enterprise Library Configuration Integration. This topic describes the two ways that you can integrate custom providers into the Enterprise Library configuration system.
  • Creating a Custom Provider. This topic provides the information required for creating a provider that you add to the application configuration using the Add Custom [provider type] menu commands in the configuration tools, and explains how you can create a fully integrated design-time experience for a custom provider.

You can download a Visual Studio project containing the example provider described in this section. The project includes a custom exception handler in both basic and full configuration integration modes, and a simple console application that uses both versions of the handler. To download the sample, go to https://www.codeplex.com/entlib/.

Note

This section does not cover extending the Unity dependency injection and interception mechanism. For information about how you can extend Unity, see the documentation available on the Unity Web site at https://www.codeplex.com/unity/.

Enterprise Library Extensibility hands-on labs will help you learn and practice not only the process of creating custom providers but also other ways you can extend Enterprise Library.