XML•Control the Custom Publisher With App.Config

Listing 5. Add the code to check for new values in App.config. You can add these values to control where the custom publisher writes its data. Here you specify a new server and database, and the custom publisher complies.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <configSections>
      <section name="exceptionManagement" type=
   "Microsoft.ApplicationBlocks.
      ExceptionManagement.
      ExceptionManagerSectionHandler,Microsoft.
      ApplicationBlocks.ExceptionManagement" />
   </configSections>
   <exceptionManagement>
      <publisher mode="on" 
         assembly="csEMABCustomPub" 
      type="csEMABCustomPub.ExceptionPublisher" 
      serverName="Web01" 
         databaseName="NewException" />
   </exceptionManagement>      
</configuration>