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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:31:03+00:00 2026-06-03T22:31:03+00:00

<configuration> <configSections> <sectionGroup name=loggingConfigs> <section name=LoggingParameters type=Framework.Logging.LoggingParameters, Framework.Logging /> </sectionGroup> </configSections> <loggingConfigs> <LoggingParameters myconfig=C:mydir\mypath1\mypath2\log4net.config

  • 0
<configuration>
  <configSections>
  <sectionGroup name="loggingConfigs">


    <section name="LoggingParameters"
          type="Framework.Logging.LoggingParameters, Framework.Logging" />

  </sectionGroup>
    </configSections>

  <loggingConfigs>

    <LoggingParameters

        myconfig="C:mydir\mypath1\mypath2\log4net.config" 

      />


  </loggingConfigs>
</configuration>   




public class LoggingParameters : ConfigurationSection
{

    [ConfigurationProperty("myconfig", IsRequired = true)]
    private string ConfigFileLoc
    {
        get { return (string)this["myconfig"]; }
    }


    public FileInfo MyConfigFile
    {
        get
        {
            string s = ConfigFileLoc;  <--- getting empty string here..don't know why
            return new FileInfo(s);
        }

    }
}

When I make the following call else where in my application,

FileInfo f = new Framework.Logging.LoggingParameters().MyConfigFile;

the ConfigFileLoc always comes back as blank. I can not figure out why its blank.. why the string is empty.. please help.

  • 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-06-03T22:31:05+00:00Added an answer on June 3, 2026 at 10:31 pm

    I had to remove the SectionGroup (don’t know if that is a requirement for you)

      <configSections>    
          <section name="LoggingParameters"
                type="Framework.Logging.LoggingParameters, Framework.Logging" />      
      </configSections>
      <LoggingParameters myconfig="C:mydir\mypath1\mypath2\log4net.config" />
    

    And got the FileInfo with this code (path is not empty anymore)

    LoggingParameters config = (LoggingParameters)ConfigurationSettings.GetConfig("LoggingParameters");
    FileInfo fInfo = config.MyConfigFile;
    

    This post by Scott Mitchell may help you

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

Sidebar

Related Questions

I have the following in my app.config. <configuration> <configSections> <sectionGroup name=FooGroup> <section name=Foo type=Bar.FooSection
my desired app.config would be like this: <configSections> <sectionGroup name=QA_Environment> <section name=databases type=System.Configuration.NameValueSectionHandler/> <section
I want to read the following xml using c#. <configuration> <configSections> <sectionGroup name=spring> <section
what I have in app.config is this <?xml version=1.0?> <configuration> <configSections> <sectionGroup name=applicationSettings type=System.Configuration.ApplicationSettingsGroup,
I'm trying to setup configSection for a .net 4.0 project. <configuration> <configSections> <section name=MonitorFldrSection
This is regarding a web.config file Here's the ConfigSection <configSections> <sectionGroup name=HttpExceptionHandler> <section name=errorLog
I'm looking for a way to avoid declaring my configuration section in the configSections
I have XML-file with settings like this <?xml version=1.0 encoding=utf-8 ?> <configuration> <configSections> <sectionGroup
Got the following exception Failed obtaining configuration for Common.Logging from configuration section 'common/logging'. while
My configuration of backends.yaml backends: - name: mybackend class: B1 instances: 1 options: dynamic

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.