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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:38:25+00:00 2026-06-01T10:38:25+00:00

I have a class library that has settings within an app.config. I know that

  • 0

I have a class library that has settings within an app.config.

I know that any project that uses this library needs to have settings in it own app.config.

Is there any way to bring the settings from the library as a template/default configuration settings?

I want to give the project a starting point, but also allow for them to override for a specific configuration for their needs.

I would appreciate the 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-01T10:38:26+00:00Added an answer on June 1, 2026 at 10:38 am

    I have also needed to do this in the past; what I recall from the research I did at the time it is not possible to mark the file as "required" and copy along with the reference. The advice from other forums and MSDN was to manually merge the App.config files in the final location.

    The solution I ended up using as a post-build script on the start-up/default project that XCOPY the App.Config file into the correct target directory. This worked well for my situation as I already had a post-build script in place to do other tasks.

    If there is indeed a better/cleaner solution I would be interested to hear it.

    Edit: Below is a cut-down version of my post-build script.

    @ECHO OFF
    SETLOCAL
    
    :: VISUAL STUDIO USAGE
    :: $(ProjectDir)..\PostBuild.bat $(TargetName) $(TargetDir) $(ProjectDir) $(ConfigurationName)
    
    SET TargetName=%1
    SET TargetDir=%2
    SET ProjectDir=%3
    SET Configuration=%4
    
    :: XCOPY Usage
    :: /I If destination does not exist and copying more than one file, assumes that destination must be a directory.
    :: /F Displays full source and destination file names while copying.
    :: /Y Suppresses prompting to confirm you want to overwrite an existing destination file.
    :: /D Copy only those files whose source time is newer than the destination time.
    :: /R Overwrites read-only files.
    :: /S Copies directories and subdirectories except empty ones.
    :: /E Include empty directories
    
    :: MOVE Usage
    :: /Y Suppresses prompting to confirm you want to overwrite an existing destination file.
    
    :: Copy the *.config to output
    ECHO F | XCOPY /F /Y /R PathToReferenceLibary\App.config %TargetDir%ReferenceLibary.dll.config
    
    :CLEAN
    ECHO =============================================================
    ECHO == Clean Unwanted Files
    ECHO =============================================================
    :: Delete unnecessary default App.config
    DEL /Q %TargetDir%App.config
    
    :: Delete license files as they should *never* be shipped!
    DEL /Q %TargetDir%*.lic
    
    :EXIT
    EXIT ERRORLEVEL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say you have a class library project that has any number of supplemental
I have a class library project that references the version 4.1 Microsoft.Practices.Common dll. I
I have a class, which is part of a code library project that was
I have a UserControl that is part of a Class library. I reference this
I have a Class Library that has an AssemblyVersion of 1.0.0.0 and has to
I have a component library. It has a manifest file that looks like this:
if you have a class library project that acts as ur DAL and it
I have created a VB.NET 2008 Class Library that has, for the most part,
My Scenario I have a class library that is going to be called from
I have a DAL class library that is included in my program as a

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.