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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:45:02+00:00 2026-05-23T12:45:02+00:00

OpenExeConfiguration has 2 overloads: ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel) —– (1) ConfigurationManager.OpenExeConfiguration (String) —– (2) OpenMappedExeConfiguration has

  • 0

OpenExeConfiguration has 2 overloads:

  • ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel) —– (1)
  • ConfigurationManager.OpenExeConfiguration (String) —– (2)

OpenMappedExeConfiguration has only 1 prototype:

  • OpenMappedExeConfiguration (ExeConfigurationFileMap fileMap,ConfigurationUserLevel userLevel) —– (3)

It seems both (2) and (3) can be used to open a specific config file rather than the default app.config file.

So what’s the difference between them? When to use which?

Why do we seperate the UserLevel and Config File Location in (1) and (2), but combine them in (3)?

Thanks for any replies.

Update

I know that Microsoft always like to do things in more than one ways. But it should do it for a reason. Any body know the reason in my question? Do we need a bounty 😉 ?

  • 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-23T12:45:02+00:00Added an answer on May 23, 2026 at 12:45 pm

    The difference is explained in the ultimate .NET config resource – Cracking the Mysteries of .NET 2.0 Configuration:

    OpenExeConfiguration (String)

    will append “.config” to the filename
    you provide and load that
    configuration file. It’s important to
    note that OpenExeConfiguration(string
    exePath) is a very misleading method,
    as the filename does not have to be
    the filename of the .exe that is
    running […]
    By providing a filename other than the
    EXE filename, an alternate *.config
    file can be opened.

    OpenExeConfiguration (ConfigurationUserLevel)

    The second method,
    OpenExeConfiguration(ConfigurationUserLevel
    level) will load the appropriate
    configuration file for the specified
    configuration level. Configuration
    levels, available in the Exe context,
    allow you to specify whether you want
    exe, roaming user, or local user
    configuration […] Remember that configuration is hierarchical and merged. When requesting roaming or local user configuration, that level up through machine.config are merged, resulting in the complete configuration accessible by your application for the given user level.

    OpenMappedExeConfiguration(), OpenMappedMachineConfiguration()

    Unlike the OpenExeConfiguration()
    methods, which make several
    assumptions about where your
    configuration files reside,
    OpenMappedExeConfiguration() and
    OpenMappedMachineConfiguration() allow
    you to explicitly specify where your
    *.config files reside on disk. Using these methods, you can load an
    alternate machine.config, load
    User.config files from the locations
    of your own choosing (vs. letting the
    .NET framework decide on some
    convoluted path), etc. When accessing
    machine.config, a custom version is
    not required,
    OpenMachineConfiguration() should be
    used instead.

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

Sidebar

Related Questions

When I use this to write to my app.config file: Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings[Wachtwoord].Value
This is my code: Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); KeyValueConfigurationCollection settings = configuration.AppSettings.Settings; settings[IP].Value =
I have a windows service which is installed to C:\Windows\System32. It has a usual
I have a class to encrypt the connectionString. public class SKM { private string
I'm using configuration manager in the simplest way: Read: ConfigurationManager.AppSettings[Foo] Write: Configuration config =
I've been working on a .NET library. Of course .NET has a good way
In the following config file excerpt, the WCF service has two endpoints. <service behaviorConfiguration=AtomTcpHub.Behavior
I'm playing around with .NET's configuration support (the ConfigurationManager class and related support classes).
OK so we have something that is currently using OpenExeConfiguration for reading a config
I'm wondering if someone has a method for detecting whether or not a thread

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.