An item with the same key has already been added.

开发环境:.Net Core 3.1,NPOI 2.6.0

前言:复制行数据时,提示错误如下:

An item with the same key has already been added. Key: 0
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)

解决方案:检查被复制的行不可以出现合并单元格。

posted @ 2023-04-18 16:28  0Behavior  阅读(976)  评论(0编辑  收藏  举报