Source Schema for Enterprise Library Core

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 Enterprise Library Core provides services, such as instrumentation and configuration, and all Enterprise Library application blocks except for the Unity Application Block are dependent on the core. The core library functionality is contained in the assembly Microsoft.Practices.EnterpriseLibrary.Common.dll.

There are two configuration sections associated with the Enterprise Library Core. They are the instrumentationConfiguration section and the enterpriseLibrary.ConfigurationSource section. These sections define which types of instrumentation are enabled in the application (if any), and which configuration source should be used to access configuration information within the application. The following XML code shows the configuration section declarations that define the locations of these configuration sections. These declarations should be defined within the <configSections> section of the application configuration file.

<configSections>

  <section name="instrumentationConfiguration"
           type="Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.Configuration.InstrumentationConfigurationSection,
                 Microsoft.Practices.EnterpriseLibrary.Common,
                 Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

  <section name="enterpriseLibrary.ConfigurationSource"
            type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection,
                 Microsoft.Practices.EnterpriseLibrary.Common,
                 Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

</configSections>

If there is no enterpriseLibrary.ConfigurationSource section in the configuration file, an instance of the SystemConfigurationSource class becomes the configuration source for the application. This means that when the application uses the static factories, it retrieves configuration information from the application configuration file.

enterpriseLibrary.ConfigurationSource Element

The enterpriseLibrary.ConfigurationSource element specifies the configuration source that the application should use. This element is not required. If it is omitted, the application uses an instance of the SystemConfigurationSource class.

The following sections describe attributes and child elements of the enterpriseLibrary.ConfigurationSource element.

Attributes

The following table lists the attributes for the enterpriseLibrary.ConfigurationSource element.

Attribute

Description

selectedSource

The configuration source to use for this application. It must be a name listed in the <sources> section. This attribute is required.

sources Element

The sources element is a child of the enterpriseLibrary.ConfigurationSource element. It lists the configuration sources that the application can use. This element is required.

add Element

The add element is a child of the sources element. It adds the name of a configuration source. This element is optional. There can be multiple add elements.

The following table lists the attributes for the add element.

Attribute

Description

name

The name of the configuration source. The name must be unique within the section. This attribute is required.

type

The type name of a class that implements the IConfigurationSource interface.

filePath

The path that points to the configuration file. This attribute is required if the configuration source is a file.

connectionString

The SQL Server connection string for the SQL Server database that contains the configuration information. This attribute is required if the configuration source is a SQL Server database.

getStoredProcedure

The name of a stored procedure in the database that contains the configuration information. This is the stored procedure to call when the application gets a configuration section. This attribute is required if the application uses a stored procedure with a SQL Server database to get a configuration section.

setStoredProcedure

The name of a stored procedure in the database that contains the configuration information. This is the stored procedure to call when the application sets a configuration section. This attribute is required if the application uses a stored procedure with a SQL Server database to set a configuration section.

refreshStoredProcedure

The name of a stored procedure in the database that contains the configuration information. This is the stored procedure to call when the application refreshes a configuration section. This attribute is required if the application uses a stored procedure with a SQL Server database to refresh a configuration section.

removeStoredProcedure

The name of a stored procedure in the database that contains the configuration information. This is the stored procedure to call when the application removes a configuration section. This attribute is required if the application uses a stored procedure with a SQL Server database to remove a configuration section.

instrumentationConfiguration Child Element

The instrumentationConfiguration element enables and disables the different types of instrumentation. This element is optional. If this element is not included in the configuration source, all instrumentation is disabled.

The following table lists the attributes for the instrumentationConfiguration element.

Attribute

Description

performanceCountersEnabled

Specifies whether the application blocks used by the application will write to the performance counters. Possible values are true or false. The default value is false. This attribute is optional.

eventLoggingEnabled

Specifies whether the application blocks used by the application will write to the event log. Possible values are true or false. The default value is false. This attribute is optional.

wmiEnabled

Specifies whether the application blocks used by the application will raise Windows Management Instrumentation (WMI) events. Possible values are true or false. The default value is false. This attribute is optional.