<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" />
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" />
    <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" />
  </configSections>
  <appSettings>
    <!-- SP6.T6 — fast-index feature flag. Set to "false" to fall back to BulkIndexLegacy. -->
    <add key="Indexing.UseLitePass" value="true" />
  </appSettings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
  </startup>
  <exceptionHandling>
    <exceptionPolicies>
      <add name="Global Policy">
        <exceptionTypes>
          <add name="Exception" type="System.Exception, mscorlib" postHandlingAction="None">
            <exceptionHandlers>
              <!-- No UI handler for console app -->
            </exceptionHandlers>
          </add>
        </exceptionTypes>
      </add>
      <add name="Log Only Policy">
        <exceptionTypes>
          <add name="Exception" type="System.Exception, mscorlib" postHandlingAction="None">
            <exceptionHandlers>
              <add logCategory="Default Category" eventId="100" severity="Error" title="Genexus Application Exception" priority="0" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" name="Logging Handler" type="Artech.Common.Exceptions.DefaultLogHandler, Artech.Common" />
            </exceptionHandlers>
          </add>
        </exceptionTypes>
      </add>
    </exceptionPolicies>
  </exceptionHandling>
  <loggingConfiguration defaultCategory="Default Category" tracingEnabled="false">
    <logFilters />
    <categorySources>
      <add name="Default Category" switchValue="All">
        <listeners>
          <add name="Flat File Destination" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <errors name="errors" switchValue="All">
        <listeners>
          <add name="Flat File Destination" />
        </listeners>
      </errors>
    </specialSources>
    <listeners>
      <add name="Flat File Destination" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" fileName="worker_entlib.log" formatter="Default Formatter" />
    </listeners>
    <formatters>
      <add name="Default Formatter" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=79a65ef946496ecc" template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}" />
    </formatters>
  </loggingConfiguration>
  <cachingConfiguration defaultCacheManager="Default Cache Manager">
    <backingStores>
      <add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" />
    </backingStores>
    <cacheManagers>
      <add name="Default Cache Manager" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory" />
    </cacheManagers>
  </cachingConfiguration>
  <runtime>
    <!-- Let managed catch blocks see corrupted-state exceptions (AccessViolation / SEH) that
         the GeneXus COM-flavoured SDK can raise on a complex edit. Without this the CLR
         terminates the process before ProcessCommand's handler runs, so a single bad SDK call
         silently kills the worker mid-request (issue #35 / homonym-Transaction crash). With it,
         ProcessCommand ([HandleProcessCorruptedStateExceptions]) turns that into a structured
         error for the in-flight call, then exits cleanly so the gateway respawns a fresh worker
         — the AppDomain is not reused after a corrupted-state exception. StackOverflow stays
         uncatchable by design; nothing here changes that. -->
    <legacyCorruptedStateExceptionsPolicy enabled="true" />
    <!-- Background (concurrent) GC keeps gen2/LOH collections from stalling the STA SDK
         thread during a long session. Workstation GC (not server) is deliberate: the
         worker is x86 with one SDK thread, so server GC's per-core heaps would waste
         address space against the ~4GB ceiling. LOH fragmentation over a long session is
         handled by a periodic idle CompactOnce in the worker (see IdleMemoryMaintenance),
         not here — .NET Framework has no config knob to force LOH compaction. -->
    <gcConcurrent enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Artech.Architecture.Interfaces" publicKeyToken="6f5bf81c27b6b8aa" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>