N
ns
I am getting the following error
"ConfigurationErrorsException was unhandled, Configuration system failed
to initialize"
This were working fine in Web based application and i am porting it to
windows form, the only thing that i removed is the version ifnormation for
the type in namevalue
I am using Windows Form & .net 2.0
Here is the App.config
===================================================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME
with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<configSections>
<sectionGroup name="CUSTOMSECTION">
<section name="DEV"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false" />
<section name="TEST"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false"/>
<section name="PROD"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false"/>
</sectionGroup >
</configSections>
<CUSTOMSECTION>
<DEV configSource="DEV.config"/>
<TEST configSource="TEST.config"/>
<PROD configSource="PROD.config"/>
</CUSTOMSECTION>
<appSettings>
<add key ="Environment" value="DEV"/>
</appSettings >
</configuration>
===================================================
here is the DEV.config
===================================================
<DEV>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</DEV>
===================================================
here is the TEST.config
===================================================
<TEST>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</TEST>
===================================================
here is the PROD.config
===================================================
<PROD>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</PROD>
===================================================
"ConfigurationErrorsException was unhandled, Configuration system failed
to initialize"
This were working fine in Web based application and i am porting it to
windows form, the only thing that i removed is the version ifnormation for
the type in namevalue
I am using Windows Form & .net 2.0
Here is the App.config
===================================================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME
with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<configSections>
<sectionGroup name="CUSTOMSECTION">
<section name="DEV"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false" />
<section name="TEST"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false"/>
<section name="PROD"
type="System.Configuration.NameValueSectionHandler,System"
restartOnExternalChanges ="false"/>
</sectionGroup >
</configSections>
<CUSTOMSECTION>
<DEV configSource="DEV.config"/>
<TEST configSource="TEST.config"/>
<PROD configSource="PROD.config"/>
</CUSTOMSECTION>
<appSettings>
<add key ="Environment" value="DEV"/>
</appSettings >
</configuration>
===================================================
here is the DEV.config
===================================================
<DEV>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</DEV>
===================================================
here is the TEST.config
===================================================
<TEST>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</TEST>
===================================================
here is the PROD.config
===================================================
<PROD>
<add key="SQl_ConString" value="ConnectionString for SQL"/>
<add key="OLEDB_ConString" value="ConnectionString for OLEDB"/>
</PROD>
===================================================