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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:31:13+00:00 2026-05-10T18:31:13+00:00

For simplicity, I generally split a lot of my configuration (i.e. the contents of

  • 0

For simplicity, I generally split a lot of my configuration (i.e. the contents of app.config and web.config) out into separate .config files, and then reference them from the main config file using the ‘configSource’ attribute. For example:

<appSettings configSource='appSettings.config'/> 

and then placing all of the key/value pairs in that appSettings.config file instead of having this in-line in the main config file:

<appSettings>     <add key='FirstKey' value='FirstValue'/>     <add key='SecondKey' value='SecondValue'/>     ... </appSettings> 

This typically works great with the application itself, but I run into problems when attempting to write unit tests that, for whatever reason, need to get at some value from a configuration section that is stored in one of these external files. (I understand that most of these would likley be considered ‘integration tests’, as they are relying on the Configuration system, and I do have ‘pure unit tests’ as well, but those are the not the problem. I’m really looking to test that these configuration values are retrieved correctly and impact behavior in the correct way).

Due to how MSTest compiles and copies the output to obfuscated-looking folders that are different from every test run (rather than to the ‘bin’ folder like you might think), it never seems to be able to find those external files while the tests are executing. I’ve tried messing around with post build actions to make this work but with no luck. Is there a way to have these external files copied over into the correct output folder at run time?

  • 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. 2026-05-10T18:31:13+00:00Added an answer on May 10, 2026 at 6:31 pm

    Found it:

    If you edit the test run configuration (by double clicking the .testrunconfig file that gets put into the ‘Solution Items’ solution folder when you add a new unit test), you get a test run configuration dialog. There’s a section there called ‘Deployment’ where you can specifiy files or whole folders from anywhere in the solution that can be copied out with the compiled assemblies at run time to the correct folder.

    In this way, I can now actually just define most of my configuration in one set of external .config files and have them automatically copied out at the run of each test.

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Don't start by thinking big. Start by thinking small. When… May 11, 2026 at 11:30 am
  • added an answer Such tools exist. They are the subject of a discipline… May 11, 2026 at 11:30 am
  • added an answer Fluent Configuration allows you to export the XML. How recent… May 11, 2026 at 11:30 am

Related Questions

For simplicity, I generally split a lot of my configuration (i.e. the contents of
For simplicity, i have the following file named test.jsp: <script language=javascript> alert(a$b.replace(/\$/g,k)); </script> I
For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the
I am creating a custom WPF control that let's say for simplicity sake has
I have a few procedures, for simplicity sake, look like the following: public string
I've always preferred to use long integers as primary keys in databases, for simplicity
I have numerous Web Services in my project that share types. For simplicity I
Let me apologize in advance for the simplicity of this question (I heard Jeff's
Are there instances where switch(case) is is a good design choice (except for simplicity)
For the sake of simplicity: There is a permission based system in place with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.