【问题标题】:.nunit file ignoring configfile paramater.nu​​nit 文件忽略配置文件参数
【发布时间】:2017-09-21 22:29:04
【问题描述】:

我已经设置了一个 .nunit 文件来指定本地和远程测试套件 App.config。这是我的代码:

<NUnitProject>
  <Settings activeconfig="local"/>
  <Config name="local" configfile="App.config">
    <assembly path="bin\Debug\Proj.dll"/>
  </Config>
  <Config name="remote" configfile="App.Remote.config">
    <assembly path="bin\Debug\Proj.dll"/>
  </Config>
</NUnitProject>

现在,当我在命令行中运行以下命令时

"nunit3-console" "test_runner.nunit" /config:remote

它仍在运行 App.config 而不是我在 Config 块中指定的 App.Remote.config 文件。我在这里遗漏了什么吗?我是否需要在我的 App.config 中有某种引用?

【问题讨论】:

  • 运行时要使用的config文件是在bin\Debug目录下吗?
  • @Charlie 不,我将 .nunit 文件和 App.Remote.config 文件放在同一个目录中。它们都位于项目根目录中

标签: c# nunit


【解决方案1】:

我错过了对我的评论的回复!如果您还没有这样做,您应该确保将配置文件复制到输出目录。

【讨论】:

    猜你喜欢
    • 2021-12-08
    • 1970-01-01
    • 2018-07-20
    • 2021-03-23
    • 2020-10-28
    • 1970-01-01
    • 2015-01-14
    • 2016-08-31
    • 1970-01-01
    相关资源
    最近更新 更多