我在使用 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/