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 6579433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:53:51+00:00 2026-05-25T15:53:51+00:00

Is it possible to add an custom configuration element at runtime. Here is my

  • 0

Is it possible to add an custom configuration element at runtime.

Here is my app.config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="NodeList"
               type="Configuration.NodeListSection, NodeListConfiguration"
               requirePermission="false" />
  </configSections>
  <NodeList>
    <nodes>
      <add name="Dev1" isdefault="false" description ="Dev server" />
      <add name="QA1" isdefault="true" description="QA server"/>
      <add name="Prod1" isdefault="false" description="Production" />
    </nodes>
  </NodeList>
</configuration>

Can we add more nodes at runtime using C# code.

  • 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-25T15:53:51+00:00Added an answer on May 25, 2026 at 3:53 pm

    This doesn’t appear to be from a built-in configuration section. You will find that “NodesList” is an section/element that is custom written. To determine where in your codebase it is coming from look for “NodesList” at the top of your config file in the configSections element. That will point you at the class to look into.

    After that, you need the class to support write operations properly.

    To learn a lot more about customising configuration files there is a great series at CodeProject on the topic. In particular, the section on Saving Configuration Changes should be helpful to you.

    Edit (after more info added to question):

    Try something like (of course it all depends on what’s in NodeListSection codebase):

    using Configuration;
    
    var nodeListSection = ConfigurationManager.GetSection("NodeList") as Configuration.NodeListSection;
    var newNode = new NodeElement() { Name = "xyz", IsDefault = false, Description = "New Guy" };
    nodeListSection.Nodes.Add(newNode);
    
    Configuration.Save(ConfigurationSaveMode.Modified);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined a custom section in the App.config file and all the Configuration
Is it possible to add custom command-line arguments to an Eclipse .app folder? In
How do you add custom converters to log4net's PatternString via the configuration file? The
is it possible to add custom data to the results so it can be
I was wondering if its possible to add custom header with classic asp. In
Is it possible to add a custom tab to a project properties page in
Is it possible to add attributes at runtime or to change the value of
Quick Question Is it possible to have more than 1 config file in a
Is it possible to add custom dictionary fields to an images metadata? The following
Is it possible to add a custom property to an object that is part

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.