While debugging my C# WinForm app, out of the nowhere this exception started coming out on code that previously worked okay. In fact, the Class in which that piece of code is doesn't even get initialized at startup. I have no clue what's going on. If I uncomment that code, the exception gets thrown on another piece of code like if some other thing is wrong in the project. It looks like a corrupted file or something that's gone bad. I am in kind of a hurry for delivery time so it's driving me crazy. Here is the exception detail:
System.Configuration.ConfigurationErrorsException
HResult=0x80131902
Message=Error en la inicialización del sistema de configuración
Source=System.Configuration
StackTrace:
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.Dns.GetHostName()
at Sigma_Admin.Custom_Classes.SygmaServer.GetIPAddress()
at Sigma_Admin.Custom_Classes.SygmaServer..ctor()
at Sigma_Admin.Main..ctor()
at Sigma_Admin.Program.Main()
Inner Exception 1:
ConfigurationErrorsException: Root element is missing.
Inner Exception 2:
XmlException: Root element is missing.
EDIT:
Here's my app.config file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Sigma_Admin.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
<userSettings>
<Sigma_Admin.Properties.Settings>
<setting name="defaultDataFile" serializeAs="String">
<value>null</value>
</setting>
<setting name="ownerAuth" serializeAs="String">
<value>jgd</value>
</setting>
<setting name="employeeAuth" serializeAs="String">
<value>ejecutivo</value>
</setting>
<setting name="interes" serializeAs="String">
<value>18</value>
</setting>
<setting name="adminIP" serializeAs="String">
<value>0</value>
</setting>
</Sigma_Admin.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="LibPowerCrypt4" publicKeyToken="43323c0f37428f68" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>