I'm getting the following exeption: "Sections must only appear once per config file. See the help topic for exceptions. "
my configuration file look like this:
<configSections>
<sectionGroup name="point.System">
<section name="singleInstanceCache"
type="xyz.Point.System.Configuration.SingleInstanceCache, Point.System" />
</sectionGroup>
<sectionGroup name="point.Services">
<sectionGroup name="xServices" type="xyz.Point.Messaging.PointServiceConfiguration.PointServices, Barcap.FIA.Point.Messaging">
<section name="xService"
type="xyz.Point.Messaging.PointServiceConfiguration.PointService, Barcap.FIA.Point.Messaging" />
</sectionGroup>
</sectionGroup>
</configSections>
<point.Services>
<xServices>
<xService name="Service1" type="IService" >
<endpoints>
<endpoint aliasName="incoming" endpointName="Subscriber"/>
<endpoint aliasName="outgoing" endpointName="Publisher"/>
</endpoints>
</xService>
<xService name="BlobService" type="IPortfolioService" >
<endpoints>
<endpoint aliasName="incoming" endpointName="Subscriber"/>
<endpoint aliasName="outgoing" endpointName="Publisher"/>
</endpoints>
</xService>
</xServices>
</point.Services>
here is the code where i load it:
public class PointServices : ConfigurationSection
{
public static PointServices Get()
{
var t = (PointServices)ConfigurationManager.GetSection("point.Services/xServices");
return null;
}
//<summary>
//Declares a collection element represented in the following configuration sub-section
//<singleInstances> <add .../> </singleInstances>
//</summary>
[ConfigurationProperty("xServices", IsDefaultCollection = true)]
[ConfigurationCollection(typeof(PointServices), AddItemName = "xService")]
public PointServicesCollection Services
{
get { return (PointServicesCollection) base["xServices"]; }
}
}
public class PointService : ConfigurationElement
{
[ConfigurationProperty("name",IsRequired = true)]
public string Name
{
get { return this["name"].ToString(); }
}
[ConfigurationProperty("type", IsRequired = true)]
public string Type
{
get { return this["type"].ToString(); }
}
[ConfigurationProperty("endpoints", IsRequired = false)]
[ConfigurationCollection(typeof(EndpointAliasCollection), AddItemName = "endpoint")]
public EndpointAliasCollection Endpoints
{
get { return (EndpointAliasCollection)this["endpoints"]; }
}
}
if you have any idea why i'm getting this error, that would be helpful.
Thanks