简体   繁体   中英

what will be the config section when adding a section to web.config?

I want to add domain key and value to my web.config for ldap authentication but when adding

<domain>
   <add key="don"  value="fffT"/>
   <add key="LD" value="LDAP://n.tt.sg/DC=ttt,DC=xx,DC=exxxx,DC=sg"/>
</domain>

it shows the error could not find schema information of value and key . What should i write instead of

  <section name="domain" type="System.Configuration.NameValueFileSectionHandler,System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>  

Do like this

<configuration> 
<appSettings> 
<add key="don"  value="fffT"/>
<add key="LD" value="LDAP://n.tt.sg/DC=ttt,DC=xx,DC=exxxx,DC=sg"/>
</appSettings>
</configuration>

Put Key and values inside appSettings Section of web.confing

System.Configuration.NameValueFileSectionHandler来自System程序集,而不是System.Web.Extensions

type="System.Configuration.NameValueFileSectionHandler, System, Version=3.5.0.0,         Culture=neutral, PublicKeyToken=b77a5c561934e089"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM