c# - 无法从终端或管道运行 .net Framework Nunit 项目
问题描述
我有一个 NUnit 项目,它有很多 .NET Framework 类库依赖项,所以项目本身就是一个 .NET Framework。
如果我从 Visual Studio 运行测试,项目运行良好并且测试运行正确。
但是,如果我尝试从终端执行相同操作,dotnet build
则会出现很多错误,例如 cli 无法恢复包,因此我无法构建项目,也无法从终端运行测试。
error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TestFixture' could not be found (are you missing a using directive or an assembly reference?)
在 Azure Pipelines 上执行此操作时,我也遇到了同样的情况。
有任何想法吗?dotnet cli 和作为 .NET Framework 的项目之间是否存在问题?
谢谢你的帮助!
解决方案
推荐阅读
- android - 从具有相同名称的键中检索值 android firebase
- javascript - 关于 Javascript For 循环
- yii2-advanced-app - Yii2 使用请求 POST 删除记录
- reactjs - 如果这个动作有 thunk 和 axios,我如何用 jest 测试一个动作?
- python - Tabula:PIP 安装程序显示“下载成功”,但无法导入
- nuget - TFS 2018 上游包管理无法从代理后面的构建服务器工作
- java - 为什么 Spring 注解和 xml 配置注入集合的方式不同?
- javascript - 如何使用以下代码在点击时淡入?
- algorithm - 算法符号 - O(n+m)
- python - SSL时获取证书信息:certificate_verify_failed