【问题标题】:The type or namespace name ' ' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)命名空间“Microsoft”中不存在类型或命名空间名称“”(您是否缺少程序集引用?)
【发布时间】:2018-07-15 01:16:57
【问题描述】:

我在 tfs 构建期间遇到错误。

The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

虽然它在特定的 tfs 代理(另一个)上运行良好。

这里我的要求是不要使用那个 TFS 代理。

任何人都可以建议,我应该在代理上安装什么 microsoft 包来解决构建问题。

我们将不胜感激。

谢谢。

【问题讨论】:

  • 这取决于您尝试从该命名空间使用什么类...通常,“Microsoft.Practices”是Enterprise Library 的一部分。
  • @RickvandenBosch 感谢您的快速回复。实际上我的角色是devops。对编码没有太多想法。你能指导一下我应该怎么做才能解决这个问题。谢谢。
  • 如果我们不知道它实际上是哪个程序集,我们将无法帮助您。其中有几个。查看代码,看看有哪些using 语句。
  • @RickvandenBosch 使用 Microsoft.Practices.EnterpriseLibrary.Data

标签: .net tfs msbuild


【解决方案1】:

请尝试以下项目以缩小问题范围:

  1. 检查您是否添加了 Nuget 任务来恢复您的包 构建定义。
  2. 确保构建服务器可以访问 Internet 或特定的 用于恢复包的 Nuget 服务器。
  3. 分析来自工作代理和失败代理的构建日志, 检查引用的程序集来自何处。将日志与 得到关键点。调试它。
  4. 根据您的说明,错过的程序集应该属于 到EnterpriseLibrary.Data。所以,你也可以尝试安装它 手动或添加复制步骤将其复制到正确的路径 代理机。
  5. 从您的项目中删除引用,然后添加引用 再次确保您的项目引用:

    • Microsoft.Practices.EnterpriseLibrary.Common
    • Microsoft.Practices.EnterpriseLibrary.Data

    然后检查更改。

参考这个类似的帖子:The type or namespace name 'Practices' does not exist in the namespace 'Microsoft'

【讨论】:

    猜你喜欢
    • 2021-08-12
    • 2018-04-19
    • 1970-01-01
    • 1970-01-01
    • 2015-02-14
    • 2017-05-04
    • 2017-05-01
    • 2020-12-17
    • 2021-07-27
    相关资源
    最近更新 更多