nUnit tests looking for {assembly-name}.dll.config

一曲冷凌霜 提交于 2019-12-05 13:09:12

The solution for this is to use the console switch /domain=multiple. When you change the default domain usage setting to use a separate AppDomain per Assembly it causes NUnit to load the projects app.config. This option is only available in NUnit 2.5 or later.

nunit-console your.project.csproj /domain=multiple

The quick answer is that NUnit doesn't manage config files. It leaves the handling of configuration files to the framework:

http://nunit.net/blogs/?p=9

If you want NUnit to use a specific configuration file, you can create an NUnit project, and copy the configuration file you wish to use into [NUnitProjectName].config. This configuration file would need to reside in the same directory as your NUnit project.

Not sure if this still applies to the OP's question , but when you build the test project multiple .dll.config files are copied over . If you need to have custom configuration for the tests , copy the .config into the test project . Then in the Properties pane set Copy to Output Directory to Copy Always , this will overwrite the projects config file .

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