An item with the same key has already been added.

发布时间 2023-04-18 16:31:58作者: 0Behavior

开发环境:.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)

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