Custom configs i web.config
Jeg vil gerne kunne hente forskellige configs ud af min web config og jeg har fulgt denne artikel http://www.4guysfromrolla.com/articles/032807-1.aspxmen jeg får fejlen The type or namespace name 'ASPNET2ConfigurationState' could not be found (are you missing a using directive or an assembly reference?) 3 steder i
[code]
public class ASPNET2ConfigurationStateCollection : ConfigurationElementCollection
{
public ASPNET2ConfigurationState this[int index]
{
get
{
return base.BaseGet(index) as ASPNET2ConfigurationState;
}
set
{
if (base.BaseGet(index) != null)
{
base.BaseRemoveAt(index);
}
this.BaseAdd(index, value);
}
}
protected override ConfigurationElement CreateNewElement()
{
return new ASPNET2ConfigurationState();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((ASPNET2ConfigurationState)element).Name;
}
}
[/code]
Hvorfor virker det ikke?