S
saurabh srivastava
""You must implement a default accessor on
System.Configuration.ConfigurationLockCollection because it inherits
from ICollection.""
Hello All,
I am having my app.config file like :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="PredefinedClusters"
type="BinaryChecker.ClusterSection,BinaryChecker"/>
</configSections>
<PredefinedClusters>
<Cluster name="Portal">
<Environments>
<Env name="aa">
<Servers>
<Server name="zz"/>
<Server name="xx"/>
</Servers>
</Env>
<Env name="bb">
<Servers>
<Server name="cc"/>
<Server name="vv"/>
</Servers>
</Env>
</Environments>
<BinaryPaths>
<BinaryPath name="common" binpath="croot\"/>
</BinaryPaths>
</Cluster>
</PredefinedClusters>
</configuration>
I wanna to access this app.config file using
ConfigurationElementCollection so I created Collections:
and Successfully able to access the contents in object.
but when I serializing the object it is giving the exception.
****** XmlSerializer ser = new
XmlSerializer(configSection.GetType());-->this line throwing the
exception
"You must implement a default accessor on
System.Configuration.ConfigurationLockCollection because it inherits
from ICollection."
Any Solution ***
System.Configuration.ConfigurationLockCollection because it inherits
from ICollection.""
Hello All,
I am having my app.config file like :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="PredefinedClusters"
type="BinaryChecker.ClusterSection,BinaryChecker"/>
</configSections>
<PredefinedClusters>
<Cluster name="Portal">
<Environments>
<Env name="aa">
<Servers>
<Server name="zz"/>
<Server name="xx"/>
</Servers>
</Env>
<Env name="bb">
<Servers>
<Server name="cc"/>
<Server name="vv"/>
</Servers>
</Env>
</Environments>
<BinaryPaths>
<BinaryPath name="common" binpath="croot\"/>
</BinaryPaths>
</Cluster>
</PredefinedClusters>
</configuration>
I wanna to access this app.config file using
ConfigurationElementCollection so I created Collections:
and Successfully able to access the contents in object.
but when I serializing the object it is giving the exception.
****** XmlSerializer ser = new
XmlSerializer(configSection.GetType());-->this line throwing the
exception
"You must implement a default accessor on
System.Configuration.ConfigurationLockCollection because it inherits
from ICollection."
Any Solution ***