【问题标题】:Build&Release Error CS0234: The type or namespace name 'Security' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)Build&Release 错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Security”(您是否缺少程序集引用?)
【发布时间】:2017-06-10 16:48:42
【问题描述】:
当我将项目提交到 vsts 以进行构建自动化时
有错误
Error CS0234: The type or namespace name 'Security' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
但我的项目可以使用 vs 在本地运行
有人知道如何解决这个错误吗?
【问题讨论】:
标签:
azure-devops
azure-pipelines
ms-release-management
【解决方案1】:
将 NuGet 还原任务添加到您的构建/发布定义中。
- 将版本更改为 0.*
- 解决方案或 packages.config 的路径:***.sln
- 为安装类型选择恢复
【解决方案2】:
您的构建找不到引用的程序集。这可能是因为缺少 nuget restore 构建步骤(在此处查看其他答案),或者因为您的存储库中缺少此特定构建的某些条目。
【解决方案3】:
在我的例子中,我忘记将 packages.config 文件添加到源代码管理中。