【问题标题】:type or namespace name 'IBehavior' could not be found on TFS Build Server在 TFS 构建服务器上找不到类型或命名空间名称“IBehavior”
【发布时间】:2015-06-16 09:11:57
【问题描述】:

我目前正在开发一个 Windows 8.1 应用商店应用程序。

在我的开发环境中,解决方案构建成功。但是,当解决方案在 TFS 构建服务器上构建时,它会失败并显示消息:

behaviors\MultiSelectBehaviorBase.cs (1): The type or namespace name 'Xaml' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 

behaviors\MultiSelectBehaviorBase.cs (28): The type or namespace name 'IBehavior' could not be found (are you missing a using directive or an assembly reference?) 

请注意,我的项目引用了 Windows 扩展:“行为 SDK (XAML)”(版本 12.0)。我跟着教程TFS Continuous Integration for Windows 8.1 Store Apps with SDK dependencies

如果没有 MultiSelectBehaviorBase.cs,它可以在 TFS 服务器上正确构建(即使项目引用了 BehaviorSDK)。

MultiSelectBehaviorBase.cs(复制自Managing Multiple selection in View Model):

public class MultiSelectBehaviorBase<T>: DependencyObject, IBehavior
{
...
}

【问题讨论】:

    标签: windows-store-apps tfsbuild build-server


    【解决方案1】:

    我知道这是几个月前发布的,我遇到了类似的问题“找不到类型或命名空间 'IBehaviour'(您是否缺少 using 指令或程序集)”。大多数情况下,发生此类错误的原因是缺少参考。为了解决这个问题,我从http://julmar.com/blog/programming/behaviors-in-windows-8-1-store-apps/得到了这个信息

    在解决方案资源管理器中的项目下,双击引用并启用行为 SDK,如下图所示Behavioural SDK demo 请注意,有些情况下无法在此处找到此类引用,您可以尝试从 NuGet 包管理器下载。我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-12
      • 2011-05-13
      • 2013-03-25
      相关资源
      最近更新 更多