I recently upgraded to ReSharper 10.0.1 for Visual Studio 2013. My unit test project contains an app.config file which contains this:
<appSettings file="AppSettings.local.config">
<add key="otherSetting" value="foo" />
</appSettings>
<connectionStrings configSource="ConnectionStrings.local.config" />
The referenced config files are set to "Copy always" to the output directory. I verified that tests are running from \bin\debug off the project folder, and that both referenced config files are copied correctly to that folder. However, when running the tests, I've observed that:
ConfigurationManager.AppSettings
DOES NOT contain any of the keys from AppSettings.local.config.ConfigurationManager.AppSettings
DOES containotherSetting
.ConfigurationManager.ConnectionStrings
DOES contain all of the keys from ConnectionStrings.local.config.- Using the
configSource
attribute instead offile
in<appSettings>
does not work either.
The way I manage config files has not changed in a very long time and has always worked fine. The problem definitely seemed to coincide with the upgrade to ReSharper 10. In ReSharper's unit testing settings, I've disabled "shadow-copy assemblies" and "use seperate AppDomain", and "Run test from" is set to project output folder. I've restarted VS many times after changing these settings.
Does this sound like a possible ReSharper bug or could I be missing something obvious?
UPDATE:
I've downgraded to ReSharper 9.2 and my woes have disappeared. So I can only conclude that this is a ReSharper 10 issue. But I'm not certain whether it's a bona fide bug (sure seems that way), or if I missed a new setting somewhere, so any insights would still be appreciated.