UiPath - issue - "Newtonsoft.Json.JsonSerializationException: Cannot create and populate list type S...

本文介绍了一种解决UiPath中出现的Newtonsoft.Json.JsonSerializationException异常的方法,该异常源于不兼容版本的Newtonsoft.Json.dll文件。通过移除并重新安装来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

【问题描述】

用 UiPath (2019.3.0 Community Edition) 编写了一个非常简单的Tool,但是运行的时候出现了异常,下图是 Designer panel 的 workflow 和 异常截图

 

以下是详细的报错信息:

19.3.0+Branch.master.Sha.5fdb43627d7d3c011018bb545ddf9470210d44a9


Cannot create and populate list type System.Collections.Generic.IReadOnlyCollection`1[System.String]. Path 'ReferencedAssemblies.$values', line 1, position 373.


System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Cannot create and populate list type System.Collections.Generic.IReadOnlyCollection`1[System.String]. Path 'ReferencedAssemblies.$values', line 1, position 373. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
Newtonsoft.Json.JsonSerializationException: Cannot create and populate list type System.Collections.Generic.IReadOnlyCollection`1[System.String]. Path 'ReferencedAssemblies.$values', line 1, position 373.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewList(JsonReader reader, JsonArrayContract contract, Boolean& createdFromNonDefaultCreator)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObje...).

 

问题关键点:
Newtonsoft.Json.JsonSerializationException: Cannot create and populate list type System
 

【解决方法】

原因:

Newtonsoft.Json 不兼容版本被加载到了 Global Assembly Cache(GAC)里边。

 

操作:

第一步,在C盘中搜索 Newtonsoft.Json.dll 

 

第二步,右键打开该文件所在文件夹 -  Open Location

第三步,往上两级,将整个 Newtonsoft.Json 文件夹 剪切到另外别的地方保存

 

第四步,重新安装 UiPath,再次运行就没有报错了

 

 


 

 

参考

https://documentation.red-gate.com/clone2/troubleshooting/common-issues/newtonsoft-json-jsonserializationexception-cannot-create-and-populate-list-type

转载于:https://www.cnblogs.com/coco1989/p/10642543.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值