read-only ConfigurationElement

I had written a custom section manager to allow the configuration for FTP logon credentials.

All was going well, I had written a class to model the credentials by inheriting from ConfigurationElement. The customer section was derived from ConfigurationSection.

So now I can write a custom section in the application config file and read the values at runtime, great I thought. the problem is that when I try to edit an element I get an "The element is read-only" exception.
After adding setter accessors to the credentials class (obvious) the problem was this little gem....

 

protected override void SetReadOnly()
{
    //do nothing!
}

 
Hope this helps!
 

Add comment