ms-release-management - 未能部署组件 - "Cannot deserialize the current JSON object ..."

标签 ms-release-management

背景资料

  • TFS 2015 RC2
  • 发布管理服务器 2015
  • 带有 2015 部署代理的 Azure VM
  • 带有 2015 部署代理的物理本地机器

  • 两台机器都需要使用 Through Release Management Server over HTTP(S) 的放置位置选项。目前我们正在使用端口 1000 上的 HTTP 端。

    工作流程
  • 停止应用程序池(工作)
  • 停止网站(工作)
  • 将网站目录复制到备份位置(工作)
  • 备份数据库(工作)
  • 部署组件(不工作),使用
  • xcopy
  • msdeploy(网络部署包)

  • 错误 (TL;DR)
    每次都收到同样的错误,不管是哪台机器或哪种部署方式。该组件总是因 JSON.NET 问题而失败。
    7/22/2015 3:03:39 PM - Error - (13704, 104) - Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.String[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
    To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
    Path 'ErrorMessage', line 1, position 16.: \r\n\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.GetPackageFileInfos(String packageLocation)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.HttpPackageDownloader.CopyPackageAndUnpackIt(String packageSourceLocation, String filesDestinationLocation)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.CopyComponentFiles()
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.DeployComponent()
    

    更新(解决方法)
    作为一种解决方法,如果我编辑构建配置以将 UNC 路径作为放置位置,则部署成功。但是我想使用 Copy build output to server选项。

    最佳答案

    卸载部署程序并安装 RM 2015 RTM 部署程序应该可以解决此问题。

    在以前的 RM 版本中存在一个问题,即在部署程序自动升级期间 NewtonSoft.Json dll 没有得到升级。

    关于ms-release-management - 未能部署组件 - "Cannot deserialize the current JSON object ...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31603767/

    相关文章:

    tfs - ClickOnce 通过 TFS 和发布管理

    c# - 使用 TFS 2015 Build vNext 的发布管理 2015

    azure - Visual Studio Team Services 发布失败 - 无关变量

    tfs - 为一个解决方案发布多个项目

    ms-release-management - 从 VSTS 发布管理将网站版本部署到 Azure

    sql-server - 用户需要被授予 Release Manager 角色才能更新现有数据库

    azure-devops - 用于发布管理的交互式变量

    .net - 发布管理客户端启动失败

    visual-studio-2015 - MS 发布管理系统变量

    azure-devops - 仅当先前的任务错误时运行 VSTS 生成/发布任务