Unity3D error: ArgumentException: Key duplication when adding: XXX
来源:互联网 发布:网络测试 编辑:程序博客网 时间:2024/06/15 08:06
今天使用 Unity 编译出现一个错误, 最后解决了,做个记录。
error:
ArgumentException: Key duplication when adding: XXXSystem.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) (at/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Hashtable.cs:831)System.Collections.Hashtable.Add (System.Object key, System.Object value) (at/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Hashtable.cs:474)
如图:
出现这种情况的原因是,由两个并发请求引起的关键字重复添加错误。
(C#脚本)
// 这在定义的时候 直接初始化,就会出现这种情况。private static Hashtable hash = new Hashtable(); hash.Add("AA",AA);hash.Add("BB",BB);hash.Add("CC",CC);
// 应该这样定义,定义hash 初始化为 null
private static Hashtable hash = nulll;// 在调用之前,再初始化:hash = new Hashtable(); // 每添加一行数据 ,初始化一次hash.Add("AA",AA);hash.Add("BB",BB);hash.Add("CC",CC);
这样就可以解决这个错误了。(~ ̄▽ ̄)~
参考资料:
http://mono.1490590.n4.nabble.com/System-ArgumentException-Key-duplication-when-adding-httpModules-td4649636.html
阅读全文
0 0
- Unity3D error: ArgumentException: Key duplication when adding: XXX
- 使用eclipse发布web服务出现"Error occured when adding the module, xxxxxx, to the server"
- Error 11011: Association End key property 'xxx' is not mapped
- JBoss中出现"Error while adding foriegn key constraint."错误的解决办法.
- Oracle Database 11g Release 2 DBCA Error At Adding Oracle JVM When Creating A Database With A Datab
- Keychain Duplicate Item When Adding Password
- ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after XXX ms
- 开机Non-system disk or disk error,replace and strike any key when ready,的解决.
- PLSQL Trigger will execute even when there is a Foreign Key Constraint Error
- mysql报错Error Code: 1022. Can't write; duplicate key in table `xxx`
- Adding iAd in your App from Unity3d
- Duplicate entry 'XXX' for key 'XXX'
- Error when enable autotrace
- ARC error when compiling
- Missing message for key "XXX"
- unity3d ArgumentException: The Assembly System.Configuration is referenced by System.Data.
- unity3d ArgumentException: The Assembly System.Configuration is referenced by System.Data...
- MySQL: [ERROR] /usr/sbin/mysqld: Incorrect key file for table './xxx/xxxx.MYI'; try to repair it
- 判断数字/字符串/实例的类型
- Duilib 源码分析之字体篇
- Linux搭建DNS服务器简要步骤
- Static关键字的用法(小白整理)
- 学习Unity Shader使用CG 标准函数
- Unity3D error: ArgumentException: Key duplication when adding: XXX
- Vue.js前后端同构方案之准备篇——代码优化
- Linux最小安装
- http请求方法get和post的区别
- 永恒之蓝 网管必备知识库 分分钟排除险情
- ECNU Problem #3263 丽娃河的狼人传说(区间贪心)
- C# 客户端 调用Java版的REST风格的web Service
- Wireshark命令行工具tshark详解(含例子)
- 二分查找算法