ERROR ENTERPRISE LIBRARY BLOQUE DE EXEPCIONES

Topics: Exception Handling Application Block
Nov 13, 2011 at 1:17 AM

Hola comunidad estoy configurando el bloque de expeciones para mi aplicacion  en el web.config de mi aplicacion y me genera el siguiente error Activation error occured while trying to get instance of type ExceptionManager, key "" ,  y asi es como tengo actualmente mi seccion de exepciones de enterprise en mi web.config

 

 

 

  <loggingConfiguration name="" tracingEnabled="true" defaultCategory="GenesisLog_Complete">

    <listeners>

      <add name="Listeners GenesisLog_Complete" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          source="Genesis Log - Traza Completa" formatter="Text Formatter"

          log="" machineName="." traceOutputOptions="None" filter="Critical" />

      <add name="Listeners GenesisMail_Complete" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          toAddress="josesierra@medilaser.com.co" fromAddress="josepaez@medilaser.com.co"

          smtpServer="192.168.11.184" formatter="Text Formatter" authenticationMode="UserNameAndPassword"

          useSSL="true" userName="NEIVA\JosePaez" password="Sistemas2010"

          traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack"

          filter="Critical" />

      <add name="Listeners GenesisLog_UI" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          source="Genesis Log - Traza Completa UI" formatter="Text Formatter 2"

          filter="Error" />

      <add name="Listeners GenesisMail_UI" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          toAddress="josesierra@medilaser.com.co" fromAddress="josepaez@medilaser.com.co"

          smtpServer="192.168.11.184" formatter="Text Formatter 2" authenticationMode="UserNameAndPassword"

          useSSL="true" userName="NEIVA\JosePaez" password="Sistemas2010"

          filter="Error" />

    </listeners>

    <formatters>

      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"

          name="Text Formatter" />

      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}"

          name="Text Formatter 2" />

    </formatters>

    <categorySources>

      <add switchValue="Critical" name="GenesisLog_Complete">

        <listeners>

          <add name="Listeners GenesisLog_Complete" />

          <add name="Listeners GenesisMail_Complete" />

        </listeners>

      </add>

      <add switchValue="Error" name="GenesisLog_UI">

        <listeners>

          <add name="Listeners GenesisLog_UI" />

          <add name="Listeners GenesisMail_UI" />

        </listeners>

      </add>

    </categorySources>

    <specialSources>

      <allEvents switchValue="All" name="All Events" />

      <notProcessed switchValue="All" name="Unprocessed Category" />

      <errors switchValue="All" name="Logging Errors &amp; Warnings">

        <listeners>

          <add name="Listeners GenesisLog_Complete" />

        </listeners>

      </errors>

    </specialSources>

  </loggingConfiguration>

  <exceptionHandling>

    <exceptionPolicies>

      <add name="UIPolicy">

        <exceptionTypes>

          <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

              postHandlingAction="None">

            <exceptionHandlers>

              <add name="Exception UI Name" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  logCategory="GenesisLog_UI" eventId="100" severity="Error"

                  title="Genesis Exception UI" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"

                  priority="0" />

            </exceptionHandlers>

          </add>

        </exceptionTypes>

      </add>

      <add name="ServicePolicy">

        <exceptionTypes>

          <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

              postHandlingAction="ThrowNewException">

            <exceptionHandlers>

              <add name="Exception Capa Servicios Name" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  logCategory="GenesisLog_Complete" eventId="200" severity="Critical"

                  title="Genesis Exception Capa Servicios" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"

                  priority="0" />

            </exceptionHandlers>

          </add>

        </exceptionTypes>

      </add>

      <add name="AplicationPolicy">

        <exceptionTypes>

          <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

              postHandlingAction="NotifyRethrow">

            <exceptionHandlers>

              <add name="Exception Capa Aplicacion Name" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  logCategory="GenesisLog_Complete" eventId="300" severity="Critical"

                  title="Genesis Exception Capa Aplicacion" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"

                  priority="0" />

              <add name="Wrap Aplicacion" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WrapHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  exceptionMessage="Genesis - Control de Excepciones:&#xD;&#xA;Capa de Aplicacion&#xD;&#xA;Se ha Generado una Excepcion en la Capa de Aplicacion con el ID Numero: {handlingInstanceID}"

                  wrapExceptionType="System.Transactions.TransactionException, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

            </exceptionHandlers>

          </add>

        </exceptionTypes>

      </add>

      <add name="PersistencePolicy">

        <exceptionTypes>

          <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

              postHandlingAction="NotifyRethrow">

            <exceptionHandlers>

              <add name="Exception Capa Persistencia Name" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  logCategory="GenesisLog_Complete" eventId="400" severity="Critical"

                  title="Genesis Exception Capa Persistencia" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"

                  priority="0" />

              <add name="Wrap Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WrapHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                  exceptionMessage="Genesis - Control de Excepciones:&#xD;&#xA;Capa de Persistencia&#xD;&#xA;Se ha Generado una Excepcion en la Capa de Persistencia con el ID Numero: {handlingInstanceID}"

                  wrapExceptionType="System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

            </exceptionHandlers>

          </add>

        </exceptionTypes>

      </add>

    </exceptionPolicies>

  </exceptionHandling>

 

y tengo correctamente las dll importadas

si pego este mismo codigo en un app.config (cliente) sirve correctamente  sera que me pueden ayudar a saber que es ?????

muchas gracias por sus respuestas comunidad 

Nov 13, 2011 at 4:35 AM

Hola,

The activation exception usually means that there is an issue with configuration.  Your configuration file is fine so I wonder if the web.config is deployed with the expected configuration.

You can verify the path of the web.config at runtime using:

var path = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath).FilePath;

Double check if that file contains the proper configuration.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com