none
How to add allowLocation and allowDefinition in the section RRS feed

  • Question

  • I created Custom configuration file and here is the part of the configSection.

    <configSections>
        <section name="deviceConfiguration" type="Test.MyDeviceConfiguration, Test" />
    </configSections>

    I want to add allowLocation and allowDefinition like following.

    <configSections>
        <section name="deviceConfiguration" type="Test.MyDeviceConfiguration, Test" allowLocation="true" allowDefinition="Everywhere"/>
    </configSections>

    How could I do that?

    Friday, December 28, 2018 3:42 AM

Answers

  • I found it.

    Here is the code.

    config.Sections["deviceConfiguration"].SectionInformation.AllowLocation = true;
    config.Sections["deviceConfiguration"].SectionInformation.AllowDefinition = ConfigurationAllowDefinition.Everywhere; 

    Please mark your reply as answered.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Jeff0803 Monday, December 31, 2018 4:37 PM
    Saturday, December 29, 2018 11:37 AM
    Moderator
  • I found it.

    Here is the code.

    config.Sections["deviceConfiguration"].SectionInformation.AllowLocation = true;
    config.Sections["deviceConfiguration"].SectionInformation.AllowDefinition = ConfigurationAllowDefinition.Everywhere; 

    • Marked as answer by Jeff0803 Saturday, December 29, 2018 5:06 PM
    Friday, December 28, 2018 3:26 PM

All replies

  • I found it.

    Here is the code.

    config.Sections["deviceConfiguration"].SectionInformation.AllowLocation = true;
    config.Sections["deviceConfiguration"].SectionInformation.AllowDefinition = ConfigurationAllowDefinition.Everywhere; 

    • Marked as answer by Jeff0803 Saturday, December 29, 2018 5:06 PM
    Friday, December 28, 2018 3:26 PM
  • I found it.

    Here is the code.

    config.Sections["deviceConfiguration"].SectionInformation.AllowLocation = true;
    config.Sections["deviceConfiguration"].SectionInformation.AllowDefinition = ConfigurationAllowDefinition.Everywhere; 

    Please mark your reply as answered.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Jeff0803 Monday, December 31, 2018 4:37 PM
    Saturday, December 29, 2018 11:37 AM
    Moderator