title: How do I configure my settings file to work with unit tests?
body: <p>I have a library I'm writing unit tests for. The library is used by two applications: one a Windows service, the other a command-line application that does some registry read-writes. Each has a slightly different App.config file that is loaded from the library at start-up. For example:</p>
  
  <pre><code>    public RetentionService()
      {
          SettingHive = new Hive();
          TimingService = new RetentionTimingService(SettingHive);
  
          AppSettingsReader asr = new AppSettingsReader();
          object appsListObj = asr.GetValue(@"blocking-process-list", Type.GetType(@"System.String"));
          string appsList = appsListObj.ToString();
          _BlockingAppNames = RetentionService.ListFromList(appsList);
  
          string targetList = asr.GetValue(@"target-files", Type.GetType(@"System.String")).ToString();
          _TargetLogs = RetentionService.ListFromList(targetList);
      }
  </code></pre>
  
  <p>When I try to use this library from a unit test, it fails to load because the application loading the library (presumably nunit) doesn't have a *.exe.config file with the appropriate keys.</p>
  
  <p>What's a better way to do this? I'd like the library to load the settings from each application's *.exe.config in production, but from a third location if running a  unit test.</p>