我们使用SoftArtisans ExcelWriter打开和处理各种excel文件中的数据。一个文件最近开始向我们显示以下错误:An item with the same key has already been added.
我尝试了Excel修复选项来修复文件和提取数据,但修复的文件和原始文件仍然返回相同的错误。
堆栈跟踪,正如承诺的那样:
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=An item with the same key has already been added.
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel..ᜀ()
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel...ctor(᜴ A_0, ᝉ A_1)
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel.ᝂ.ᜀ()
at SoftArtisans.OfficeWriter.ExcelWriter.Model.ᜉ..ctor(ល A_0, រ A_1, ᝣ A_2, ᡆ A_3)
at SoftArtisans.OfficeWriter.ExcelWriter.Model.ល..ctor(ᝣ A_0, ᠐ A_1)
at SoftArtisans.OfficeWriter.ExcelWriter.Model.ោ..ctor(ᝣ A_0, IEnumerable`1 A_1)
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel...ctor(᜔ A_0, A_1, ᝂ A_2, ឤ A_3)
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel..ᜄ()
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel.᜔.ᜀ()
at SoftArtisans.OfficeWriter.ExcelWriter.XMLModel.᜔..ctor(Stream A_0, String A_1, A_2)
at SoftArtisans.OfficeWriter.ExcelWriter.ᜊ.ᜀ(Stream A_0, String A_1, Boolean A_2)
at SoftArtisans.OfficeWriter.ExcelWriter.ᜊ.ᜀ(Stream A_0, Boolean A_1)
at SoftArtisans.OfficeWriter.ExcelWriter.ExcelApplication.Open(Stream stream)发布于 2016-01-16 03:40:30
听起来像是在您或SoftArtisan的代码中的某处有一个System.Collections.Generic.Dictionary,其中添加了两个具有相同键的对象。
https://stackoverflow.com/questions/30850031
复制相似问题