无法部署组件 - "Cannot deserialize the current JSON object ..."



背景信息

  • tfs 2015 rc2
  • 发布管理服务器2015
  • Azure VM with 2015部署代理
  • 使用2015部署代理的物理本地机

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

<<p> 工作流/strong>
  1. Stop App Pool (Working)
  2. 停止网站运行
  3. 将网站目录复制到备份位置(Working)
  4. Backup Database (Working)
  5. 部署组件(不工作),使用其中之一
    • msdeploy (web部署包)

Error (TL;DR)
每次都会收到相同的错误,这与哪台机器或哪种部署方法无关。该组件总是以JSON失败。净问题。

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.: rnrn   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没有得到升级。

我认为微软并没有真正在Update 1中测试代理版本。我得到了同样的错误,这实际上只是一个通用的错误信息,当使用部署通过HTTP。当我通过UNC路径将其转换为部署时,我发现了问题所在。

正如您可能知道的,对于TFS 2015,您必须将发布组件精确地命名为工件名称。所以工件'WebApp X'在RM中有一个名为'WebApp X'的发布组件,子路径为'WebApp X'。

在我的发布配置中,我有3个不同的组件(和工件)。所以磁盘上是:

  • 制造 WebApp X"
  • ' 制造 WebApp Y '
  • 制造 WebApp Z的

与2015 RTM完美配合。现在在更新1之后,它查找以下内容:

  • 'buildWebApp XWebApp X'
  • 'buildWebApp XWebApp Y '
  • 'build'WebApp XWebApp Z'

我不知道为什么它会这样做,以及如何解决这个问题,但我手动更改了工件掉落位置的文件夹,RM拾起了它。所以还在寻找如何修复这个,使其正常工作

如果运行RM服务器应用程序池的用户无法访问组件的放置位置,并且您选择了'通过RM服务器http(s)选项',则会出现此json问题

所以作为一个修复,你可以给应用池用户访问drop的权限。您可以在服务器日志中看到正确的错误。"包位置'share'不存在或应用程序池用户没有访问权限"

相关内容

最新更新