it:ad:nconfig:howto:get_it_to_find_the_app.config_when_running_under_mstest

Summary

NConfig relies on finding override files where expected

THe default location that Projects:XActLib's IAppHostSettingsService searches is: Config\MachineSpecificSettings\{machineName}app.config

Which – if you've made sure to mark the override app.config with Content and Copy if Newer – works fine under IT:AD:NUnit.

But when running under MSTest, the output bin is going to be something akin to:

C:\Users\SkyS\AppData\Local\Temp\TestResults\skys_SKYSW8LT 2014-03-02 19_15_21\Out\Config\MachineSpecificSettings\app.config

and because MSTest by default does not honour 'Content/Copy if Newer', there will be custom app.config file there.

I gave up and switched to using IT:AD:NUnit but then came across the following instructions…which may be the right ticket:

  • /home/skysigal/public_html/data/pages/it/ad/nconfig/howto/get_it_to_find_the_app.config_when_running_under_mstest.txt
  • Last modified: 2023/11/04 23:00
  • by 127.0.0.1