c# - AppVeyor:构建失败:无法找到 NUnit 程序集

标签 c# visual-studio-2015 nunit nunit-3.0 appveyor

我在使用 NUnit 构建这些简单测试时遇到问题。项目使用 MStest 通过了构建,但是当我切换到 NUnit 时,构建就失败了。

我在构建过程中遇到的错误基本上是:

Could not resolve this reference. Could not locate the assembly "nunit.framework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

我从 NUGET 下载了 NUnit 3.5,并将 .dll 添加到我的引用中,但仍然没有任何结果。我还确保该引用的属性将复制本地属性设置为 true。

这是我在 AppVeyor 上的构建日志 URL ( https://ci.appveyor.com/project/ReevMich/traviscitest/build/1.0.26 )

这是我的 appveyor.yml 内容(如果有帮助的话):

version: 1.0.{build}
branches:
  only:
  - master
  - dev

configuration: Debug

before_build:
  - nuget restore 

build:
  verbosity: minimal
  project: FizzBuzz.sln

test:
  assemblies:
    - '**\*.Test.dll'
artifacts:  
- path: '**\*.nupkg'
  name: NuGet

最佳答案

从存储库 ( it doesn't contain assemblies anyway ) 中删除 packages 文件夹,以便在构建过程中始终使用 nuget Restore 重新创建它。

关于c# - AppVeyor:构建失败:无法找到 NUnit 程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40950976/

相关文章:

c# - 将 JSON 转换为 XML

entity-framework - 为什么 VS 2015 需要引用 System.Data.Entity 而 VS 2013 不需要?

c# - 从命令行运行时,NUnit 看不到 configSource 定义的连接字符串

c# - 如何在用 C# 编写的 Selenium WebDriver(Nunit 测试用例)中按 "Enter"?

c# - 如何在异常中打印完整的堆栈跟踪?

c# - 了解 yield 关键字和 LINQ

c# - SqlDataReader 按列名取值(不是序号)

c# - UseSqlServer 未在 DbContextOptionBuilder 中定义

git - Visual Studio 2015 更新 2 - Git 向我展示了所有 bin\debug 和 obj\debug 文件夹/文件的更改,为什么它会忽略 gitignore

c# - 如何配置 TeamCity 以同时运行测试而不是一个接一个地运行?