S
stephen
Hi all,
I am getting this error:
An unhandled exception of type 'System.Configuration.ConfigurationException'
occurred in system.web.dll
Additional information: Exception creating section handler.
I am trying to create a general log file (VB.NET) which can either write to
a textfile or eventlog. I want to use this either in web app or windows app.
it worked fine on windows app but when i try using web app it gives the
error above.
It occurs at:
txtFileLoggerConfig =
CType(ConfigurationSettings.GetConfig("TxtFileLoggerConfigurations"), _
NameValueCollection)
Here is my web.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="TxtFileLoggerConfigurations"
type="System.Configuration.NameValueSectionHandlerSystem" />
<section name="EventLoggerConfigurations"
type="System.Configuration.NameValueSectionHandlerSystem" />
</configSections>
<appSettings>
<add key="LogClassID" value="TxtFileLogger" />
<add key="DataProviderType" value = "sql" />
<add key="ConnectionString" value="data source=(local);........;connect
timeout=120" />
</appSettings>
<TxtFileLoggerConfigurations>
<add key="FileName" value="TxtFileLogger.txt"/>
</TxtFileLoggerConfigurations>
<EventLoggerConfigurations>
<add key="LogName" value="EventLogger"/>
<add key="MachineName" value="."/>
</EventLoggerConfigurations>
<system.web>
<httpModules>
<add
type="AspNetResources.CustomErrors4.MyErrorModule,CustomErrors4"
name="MyErrorModule" />
</httpModules>
.......... rest of the config file
I am getting this error:
An unhandled exception of type 'System.Configuration.ConfigurationException'
occurred in system.web.dll
Additional information: Exception creating section handler.
I am trying to create a general log file (VB.NET) which can either write to
a textfile or eventlog. I want to use this either in web app or windows app.
it worked fine on windows app but when i try using web app it gives the
error above.
It occurs at:
txtFileLoggerConfig =
CType(ConfigurationSettings.GetConfig("TxtFileLoggerConfigurations"), _
NameValueCollection)
Here is my web.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="TxtFileLoggerConfigurations"
type="System.Configuration.NameValueSectionHandlerSystem" />
<section name="EventLoggerConfigurations"
type="System.Configuration.NameValueSectionHandlerSystem" />
</configSections>
<appSettings>
<add key="LogClassID" value="TxtFileLogger" />
<add key="DataProviderType" value = "sql" />
<add key="ConnectionString" value="data source=(local);........;connect
timeout=120" />
</appSettings>
<TxtFileLoggerConfigurations>
<add key="FileName" value="TxtFileLogger.txt"/>
</TxtFileLoggerConfigurations>
<EventLoggerConfigurations>
<add key="LogName" value="EventLogger"/>
<add key="MachineName" value="."/>
</EventLoggerConfigurations>
<system.web>
<httpModules>
<add
type="AspNetResources.CustomErrors4.MyErrorModule,CustomErrors4"
name="MyErrorModule" />
</httpModules>
.......... rest of the config file