title: System.Configuration.ConfigurationException when running a serviece build on .NET 4.0 on Windows Server 2012
body: <p>Good Day.</p>
  
  <p>I have an existing windows service that is running well on Windows Service 2003 using or .NET 4.0. I am trying to install the same service on Windows Service 2012 and was successful. However, when I run the service, I got the error below. I believe Windows Server support 4.5 which also includes 4.0, is this correct? </p>
  
  <p>Can anyone help me identify why I'm getting the message below?</p>
  
  <pre><code>Log Name:      Application
  Source:        .NET Runtime
  Date:          8/17/2015 5:56:56 AM
  Event ID:      1026
  Task Category: None
  Level:         Error
  Keywords:      Classic
  User:          N/A
  Computer:      usa0300vm1598.na.xerox.net
  Description:
  Application: ATLAS_LETTERPROCESS.SERVICE.exe
  Framework Version: v4.0.30319
  </code></pre>
  
  
  
  <pre><code>Description: The process was terminated due to an unhandled exception.
  Exception Info: System.Configuration.ConfigurationErrorsException
  Stack:
     at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
     at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String)
     at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
     at System.Configuration.ConfigurationManager.get_AppSettings()
     at ATLAS_LETTERPROCESS.SERVICE.AtlasLetterProcess..ctor()
     at ATLAS_LETTERPROCESS.SERVICE.Program.Main()
  </code></pre>
  
  <p>Event Xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
      &lt;Provider Name=".NET Runtime" /&gt;
      &lt;EventID Qualifiers="0"&gt;1026&lt;/EventID&gt;
      &lt;Level&gt;2&lt;/Level&gt;
      &lt;Task&gt;0&lt;/Task&gt;
      &lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt;
      &lt;TimeCreated SystemTime="2015-08-17T09:56:56.000000000Z" /&gt;
      &lt;EventRecordID&gt;58020&lt;/EventRecordID&gt;
      &lt;Channel&gt;Application&lt;/Channel&gt;
      &lt;Computer&gt;usa0300vm1598.na.xerox.net&lt;/Computer&gt;
      &lt;Security /&gt;
    &lt;/System&gt;
    &lt;EventData&gt;
      &lt;Data&gt;Application: ATLAS_LETTERPROCESS.SERVICE.exe
  
  Framework Version: v4.0.30319  
  Description: The process was terminated due to an unhandled exception.
  
  Exception Info: System.Configuration.ConfigurationErrorsException
  Stack:
     at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
     at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String)
     at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
     at System.Configuration.ConfigurationManager.get_AppSettings()
     at ATLAS_LETTERPROCESS.SERVICE.AtlasLetterProcess..ctor()
     at ATLAS_LETTERPROCESS.SERVICE.Program.Main()
  &lt;/Data&gt;
    &lt;/EventData&gt;
  &lt;/Event&gt;
  </code></pre>
  
  <p>Below is the current app.config file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" &gt;
        &lt;section name="ATLAS_LETTERPROCESS.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="Intentionally Hidden" connectionString="metadata=res://*/AtlasLetterProcess.csdl|res://*/AtlasLetterProcess.ssdl|res://*/AtlasLetterProcess.msl;provider=Oracle.DataAccess.Client;provider connection string=&amp;quot;DATA SOURCE=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = Intentionally Hidden)(PORT = Intentionally Hidden))) (CONNECT_DATA = (SERVICE_NAME = Intentionally Hidden)));User Id= Intentionally Hidden;Password=Intentionally Hidden;&amp;quot;" providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
    &lt;oracle.dataaccess.client&gt;
      &lt;settings&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor bindinfo='mode=Output'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_LETTER_ID;
             BaseColumnName=TL_LETTER_ID; BaseSchemaName=CMS_USER;BaseTableName=TBL_LETTER;
             NativeDataType=number;ProviderType=Int32'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_ATLAS_KEY_ID;
             BaseSchemaName=CMS_USER;BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_INPUT_XML;
             BaseSchemaName=CMS_USER;BaseTableName=TBL_LETTER;
             NativeDataType=clob;ProviderType=Clob'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_DART_URL;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=Varchar2;ProviderDBType=String;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_STATUS;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=char;ProviderType=char;ProviderDBType=String;ColumnSize=2;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_TYPE;
                   BaseSchemaName=CMS_USER;BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_MODE;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=char;ProviderType=char;ProviderDBType=String;ColumnSize=1;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_REMARKS;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=2000;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TL_TASK_ID;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=50;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TEMPLATE_NAME;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=100;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TEMPLATE_PATH;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=2000;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=PULL_DART_INVOICE;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=char;ProviderDBType=String;ColumnSize=1;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=DESCRIPTION;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=100;
                   DataType=System.String;AllowDBNull=true'"/&gt;
  
        &lt;add name="Intentionally Hidden" value="implicitRefCursor metadata='ColumnName=TEMPLATE_IDENTIFIER_TYPE;BaseSchemaName=CMS_USER;
                   BaseTableName=TBL_LETTER;NativeDataType=varchar2;ProviderType=varchar2;ProviderDBType=String;ColumnSize=100;
                   DataType=System.String;AllowDBNull=true'"/&gt;
      &lt;/settings&gt;
    &lt;/oracle.dataaccess.client&gt;
    &lt;appSettings&gt;
  
      &lt;add key="CCLLetterPath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Output\CCLLetters\"/&gt;
      &lt;add key="AutoLetterPath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Output\AutoLetters\"/&gt;
      &lt;add key="OnDemandPath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Output\OnDemandLetters\"/&gt;
      &lt;add key="AutoStopPath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Output\AutoStopLetters\"/&gt;
      &lt;add key="XSDPath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\XSD\LetterProcess.xsd"/&gt;
      &lt;add key="LogFilePath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Log\"/&gt;
      &lt;add key="LogFileName" value="ATLAS_LETTERPROCESS"/&gt;
      &lt;add key="HeaderImage" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Header.jpg"/&gt;
      &lt;add key="DeleteFiles" value="Y"/&gt;
      &lt;add key="ArchivePath" value="D:\Atlas_Collection_Services\AtlasLetterProcess\Archive\"/&gt;
      &lt;!-- Print Center Configurations--&gt;
      &lt;add key="ServerAddress" value="Intentionally Hidden" /&gt;
      &lt;add key="UserName" value="Intentionally Hidden" /&gt;
      &lt;add key="Password" value="Intentionally Hidden" /&gt;
      &lt;add key="LicenseKey" value="Intentionally Hidden" /&gt;
      &lt;add key="LicenseOwner" value="Intentionally Hidden" /&gt;
      &lt;add key="ChangeWorkingDirectory" value="/collectltr/Prod/" /&gt;
      &lt;add key="ServerPort" value="22" /&gt;
      &lt;!--Email Details--&gt;
      &lt;add key="SMTPServer" value="Intentionally Hidden" /&gt;
      &lt;add key="EmailSupportFrom" value="AtlasLetterProcessProd@Intentionally Hidden"/&gt;
      &lt;add key="EmailSupportTo" value="Intentionally Hidden@Intentionally Hidden"/&gt;
      &lt;add key="EmailSupportCC" value=""/&gt;
      &lt;add key="EmailSupportBCC" value=""/&gt;
      &lt;add key="EmailSubject" value="Atlas LetterProcess(Prod): Error in letter process service."/&gt;
      &lt;add key ="ErrorStartLine" value = "****************** Error Message ******************" /&gt;
      &lt;add key ="EndLine" value = "***************************************************" /&gt;
      &lt;!--ATLAS--&gt;
      &lt;add key="AtlasUsername" value="Intentionally Hidden" /&gt;
      &lt;add key="AtlasPassword" value="Intentionally Hidden" /&gt;
      &lt;add key="AtlasSessionType" value="Stateless" /&gt;
      &lt;add key="AtlasExpirationHours" value="10" /&gt;
      &lt;add key="AtalasServiceURL"  value="http://Intentionally Hidden:8080/eai_enu/start.swe?SWEExtSource=WebService&amp;amp;SWEExtCmd=Execute&amp;amp;WSSOAP=1"/&gt;
      &lt;!--Service Timing--&gt;
      &lt;add key="AutoMode" value="ON" /&gt;
      &lt;add key="ServiceStartTime" value="01:00" /&gt;
      &lt;add key="ServiceEndTime" value="23:00" /&gt;
      &lt;add key="ServiceInterval" value="60000" /&gt;
      &lt;add key="ServiceDay" value="1,2,3,4,5,6,0" /&gt;
      &lt;!--Mon-1,Tue-2,Wed-3,Thr-4,Fri-5,Sat-6,Sun-0--&gt;
      &lt;!--Dart Service configurations--&gt;
      &lt;add key="DARTServiceURL" value="Intentionally Hidden"/&gt;
      &lt;add key="DartUsername" value="Intentionally Hidden"/&gt;
      &lt;add key="DartPassword" value="Intentionally Hidden"/&gt;
      &lt;add key="PartitionLimit" value="1000" /&gt;
      &lt;add key="ExcludeInvoiceCodes" value="78,79,RD,TD,SD" /&gt;
  
    &lt;/appSettings&gt;
    &lt;applicationSettings&gt;
      &lt;ATLAS_LETTERPROCESS.Common.Properties.Settings&gt;
        &lt;setting name="ATLAS_LETTERPROCESS_Common_DARTWebService_DARTWebServiceService"
            serializeAs="String"&gt;
          &lt;value&gt;Intentionally Hidden&lt;/value&gt;
        &lt;/setting&gt;
      &lt;/ATLAS_LETTERPROCESS.Common.Properties.Settings&gt;
    &lt;/applicationSettings&gt;
    &lt;system.web&gt;
      &lt;webServices&gt;
        &lt;soapExtensionTypes&gt;
          &lt;add type="ATLAS_LETTERPROCESS.SoapExtension.SiebelSoapExtension, ATLAS_LETTERPROCESS.SoapExtension" /&gt;
        &lt;/soapExtensionTypes&gt;
      &lt;/webServices&gt;
      &lt;membership defaultProvider="ClientAuthenticationMembershipProvider"&gt;
        &lt;providers&gt;
          &lt;add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;roleManager defaultProvider="ClientRoleProvider" enabled="true"&gt;
        &lt;providers&gt;
          &lt;add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" /&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
    &lt;/system.web&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
    &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>