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?
Aucun commentaire:
Enregistrer un commentaire