部署组件失败 - "无法反序列化当前的JSON对象......"

Ash*_*way 7 ms-release-management

背景资料

  • TFS 2015 RC2
  • Release Management Server 2015
  • Azure VM与2015部署代理
  • 具有2015部署代理的物理本地计算机

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

工作流程

  1. 停止应用程序池(工作)
  2. 停止网站(工作)
  3. 将网站目录复制到备份位置(工作)
  4. 备份数据库(工作)
  5. 部署组件(不工作),使用其中任何一个
    • XCOPY
    • msdeploy(Web部署包)

错误(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()
Run Code Online (Sandbox Code Playgroud)

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

小智 0

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

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