"shapper" <mdmoura@gmail.comwrote in message
news:d97dc93c-48d8-4327-b1a2-2aaa8e227f01@b2g2000prf.googlegroups.com...
Quote:
Hello,
>
On a custom Web.Config section I keep having the same error. This is
driving me crazy!!!
>
I keep having the following error:
Unrecognized attribute 'Type'. Note that attribute names are case-
sensitive. (C:\Documents and Settings\Miguel\My Documents\Website
\web.config line 42)
>
On code line:
object parent = ConfigurationManager.GetSection("projSettings");
>
And Web.Config line 42 is:
<add Key="AdSense" Type="Client" Access="one"/>
>
....
Quote:
This is my Web.Config:
....
Quote:
<projSettings>
<Google>
<add Key="AdSense" Type="Client" Access="one"/>
<add Key="Analytics" Type="UserAccount" Access="two"/>
</Google>
</projSettings>
>
....
Quote:
public class Google : ConfigurationElement, IKeyProvider {
[ConfigurationProperty("Key", IsRequired = true)]
public string Key { get; set; }
public string Type { get; set; }
public string Access { get; set; }
}
What happens if you use a ConfigurationProperty attribute on Type and
Access?
--
John Saunders | MVP - Connected System Developer