[Help needed]: Error retrieving data from Web.config.

D

DS

Hi all,

Will appreciate if someone can help me with this problem.

I am using VS 2003 on Win2000, sp 4. 2GB RAM.
Session data is stored on DB on another machine in network. Can
connect to the DB (no problem with that). I try to save DB connection
string in web.config file, as described in MSDN 'Declaring and
Accessing Section Groups' article. I think this is optimal way/place
to store global variables accessible from any part of application. I
am getting following error while trying to retrieve value from
Web.config:

==
Parser Error Message: Exception creating section handler.
Source Error:
Line 5: type="System.Configuration.SingleTagSectionHandler"/>
Line 6: <sectionGroup name="dddSqlGroup">
Line 7: <section name="sqlConnectionCrd"
type="System.Configuration.NameValueSectionHandler,System" />
Line 8: </sectionGroup>
Line 9: </configSections>

Source File: C:\Inetpub\wwwroot\Memocast\web.config Line: 7
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'System' could not be loaded.
=

Web.config file:
====
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="dddcastSection"
type="System.Configuration.SingleTagSectionHandler"/>
<sectionGroup name="dddSqlGroup">
<section name="sqlConnectionCrd"
type="System.Configuration.NameValueSectionHandler,System" />
</sectionGroup>
</configSections>

<dddSqlGroup>
<sqlConnectionCrd>
<add key="sqlConnectStr" value="Persist Security
Info=False;Integrated
Security=false;database=dddcast;server=dddCSQL;User
ID=sa;Password=dsadsaaa;Connect Timeout=30" />
</sqlConnectionCrd>
</dddSqlGroup>

<system.web>

.....
other config sections
===

DS
 
K

Karl Seguin

For assemblies located in the GAC (which System is) you need to specify the
assemblies strong name:

System.Configuration.NameValueFileSectionHandler, System,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


Karl
 

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,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top