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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:24:53+00:00 2026-05-27T09:24:53+00:00

I have a command line application that reads some settings from the app.config file,

  • 0

I have a command line application that reads some settings from the app.config file, using the usual Properties.Settings.blabla properties.

This application is also used as a dll.

When I use it as a dll, it ignores any foo.exe.config that I drop in the directory. It doesn’t throw an exception as I expected when using the methods that access the config file, but it doesn’t take the config file either.

Is there a way to have an exe that is being used as a dll consume its own settings file, and still have it use the app.config file when used an an exe? I don’t want to change neither the consumer code, and I want as little impact as possible on the exe code.

I’ve seen solutions using ConfigurationManager.OpenMappedExeConfiguration Method or OpenExeConfiguration, is the solution using those methods inside the exe code? That way it will always look for the config file, regardless of if it is being used as dll or exe?

  • 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-27T09:24:54+00:00Added an answer on May 27, 2026 at 9:24 am

    If you want to do that, you’ll need to read specifically from that file. A .NET executable reads from it’s own app.config file. Library code always reads from the app.config file for the application being executed… even library code that just happens to have been compiled into a file with an .exe extension.

    Edit for Emphasis/Clarification
    When I speak of an app.config, I am of course talking about the appropriately-renamed [program.exe.config] file.

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

Sidebar

Related Questions

I have a command-line application called xooky_nabox that was programmed using c++. It reads
We have an application that installs SQL Server Express from the command line and
I have an application which is built from command line (ANT) using J2ME Polish.
I have a command line executable that alters some bits in a file that
I have a VB web application that reads from a CSV file which contains
I have a small command-line application written in C that acts as a wrapper/launcher
I have a command line application that runs on a windows server. The command
I have inherited a 20-year-old interactive command-line unix application that is no longer supported
I have a very simple command line Java application that I wish to port
I have one spring batch application which can be run from command line. The

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.