ReSharper 10 test runner failing to find AppSettings referenced from external file

大兔子大兔子 提交于 2019-12-10 18:23:01

问题


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:

  1. ConfigurationManager.AppSettings DOES NOT contain any of the keys from AppSettings.local.config.
  2. ConfigurationManager.AppSettings DOES contain otherSetting.
  3. ConfigurationManager.ConnectionStrings DOES contain all of the keys from ConnectionStrings.local.config.
  4. Using the configSource attribute instead of file 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.


回答1:


It is a known issue for R# 10.0.0 and R# 10.0.1 releases. Fixed in R# 10.0.2 EAP builds



来源:https://stackoverflow.com/questions/34048507/resharper-10-test-runner-failing-to-find-appsettings-referenced-from-external-fi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!