'System.Configuration.ConfigurationException' Error..... Please advice

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top