Azure devops 建造及保养;发布错误CS0234:类型或命名空间名称';安全';命名空间中不存在';微软';(是否缺少程序集引用?)

Azure devops 建造及保养;发布错误CS0234:类型或命名空间名称';安全';命名空间中不存在';微软';(是否缺少程序集引用?),azure-devops,azure-pipelines,ms-release-management,Azure Devops,Azure Pipelines,Ms Release Management,当我将一个项目提交给vsts进行构建自动化时 它有一个错误 Error CS0234: The type or namespace name 'Security' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 但是我的项目可以在本地使用vs 有人知道如何修复此错误吗?将NuGet Restore任务添加到生成/发布定义中 将版本更改为0* 解决方案或包的路径。配置:**.

当我将一个项目提交给vsts进行构建自动化时

它有一个错误

Error CS0234: The type or namespace name 'Security' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
但是我的项目可以在本地使用vs


有人知道如何修复此错误吗?

将NuGet Restore任务添加到生成/发布定义中

  • 将版本更改为0*
  • 解决方案或包的路径。配置:**.sln
  • 选择“还原”作为安装类型

  • 您的生成找不到引用的程序集。这可能是因为缺少nuget restore build步骤(请参阅此处的另一个答案),或者是因为您的存储库中缺少此特定版本的某些条目。

    在我的示例中,我忘记了将packages.config文件添加到源代码管理中