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

  • Home
  • SEARCH
  • 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 6241699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:48:54+00:00 2026-05-24T11:48:54+00:00

When getting the file path of the current configuration file, what is the difference

  • 0

When getting the file path of the current configuration file, what is the difference in using the AppDomain namespace and the ConfigurationManager namespace? And when would you use one over the other?

For example, both return the same path:

string f1 = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

string f2 = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None ).FilePath;
  • 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-24T11:48:55+00:00Added an answer on May 24, 2026 at 11:48 am

    It comes down to when and why you want a configuration file. The gist of it is this:

    • The ConfigurationManager will pull the configuration file for the application itself (optionally restricted by the current user).
    • The AppDomain will hand back whatever configuration file it was loaded with (which, in some cases, may be the same file as the application).

    As a rough example, let’s take a hypothetical application that can use plugins that it adds/removes on the fly. You don’t want to have to keep those plugin assemblies in memory for the life of the application, that would defeat the purpose, so you create a separate AppDomain within your application. It will handle the loading and communication between the app and the plugin assemblies, do whatever you need to do with them and the app can unload the assemblies by dropping the AppDomain whenever it needs to.

    The plugin AppDomain has quite a few settings that you’d rather keep separate from the client configuration file, so when you create the AppDomain you specify the separate file location. Within that AppDomain, the configuration file is that file.

    The client configuration, though, may depend on who’s using it (and they may have the ability to change it and customize their settings). You’d rather use an application-wide configuration that’s segregated by a given user instead and not even give them the option to mess with the plugin-specific settings (or other user’s settings). The ConfigurationManager could theoretically pull from any number of files.

    That’s a very general idea that handwaves away all of the implementation, but hopefully that starts to illustrates how the two might differ.

    Here are the MSDN pages for both the AppDomainSetup and OpenExeConfiguration() as well, which may be useful and has additional links to configuration-related resources.

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

Sidebar

Related Questions

I am using and getting a file from ftp server. But when I use
Possible Duplicates: Getting the path of the current assembly C#: How do I get
Is it possible to use jQuery to find the current url's filename (path) when
I have a piece of VB code that dynamically finds my current file path
Windows has GetFileTime API which allows getting file time information by open file handle.
Jeff wrote about getting a file version/datestamp a while back. Visual studio doesn't increment
Possible Duplicate: Getting a FILE* from a std::fstream Is there a way to obtain
The size of my JavaScript file is getting out of hand because I have
I need a little help getting a tar file to download from a website.
I'm running into significant difficulty getting my mapping file to work with a collection

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.