Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 479917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:50:25+00:00 2026-05-13T00:50:25+00:00

I’m getting the following exeption: Sections must only appear once per config file. See

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:50:25+00:00Added an answer on May 13, 2026 at 12:50 am

    You are trying to use a section group as a collection, and sections as items in the collection, which is not what they are intended for, hence the error.

    Basically you only need to define point.Services as a section, as it does not need to contain any other sections, then define a collection property to contain configuration elements. You can update the code as follows:

    Config:

    <configSections>
        <section name="point.Services" 
            type="xyz.Point.Messaging.PointServiceConfiguration.PointServices, Barcap.FIA.Point.Messaging" />
    </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>
    

    Then the code is:

    public class PointServices : ConfigurationSection
    {
        public static PointServices Get()
        {
            return (PointServices) ConfigurationManager.GetSection("point.Services");
        }
    
        [ConfigurationProperty("xServices", IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(PointService), 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(EndpointAlias), AddItemName = "endpoint")]
        public EndpointAliasCollection Endpoints
        {
            get { return (EndpointAliasCollection) this["endpoints"]; }
        }
    }
    

    To break it down:

    • PointServices is a configuration section that maps to <point.Services> section, so the static Get() method reflects this
    • PointServices defines a collection property Services which is a PointServiceCollection where the item type is PointService (NOT PointServices) and is mapped to the element name xService
    • PointService elements are elements and not sections, again note that the collection property attribute defines the item type, not the container type

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.