保存 EPPlus 工作表在切换 CurrentCulture 时引发错误

Saving EPPlus worksheet throws on error when switching CurrentCulture

我们有一个创建 excel 文件的模块,用户可以下载它。我们正在使用 EPPlus v4.0.1.1 来构建文件。当用户的文化代码为 "tr-TR" 时存在错误,saveAs 会抛出 "An item with the same key has already been added" 错误。但是当我们把它切换回"en-US"时,它保存成功了。

代码如下:

var currentCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); 
var tempStream = new FileStream(Path.GetTempFileName(), FileMode.Create, FileAccess.ReadWrite, FileShare.Read, 4096, FileOptions.DeleteOnClose);
package.SaveAs(tempStream);

有人可以帮我解释为什么 EPPlus 会针对这种特定文化抛出错误吗?谢谢

我已通过将 EPPlus 版本从 4.0.1.1 更新到 4.1.0.0 来修复错误

显然,旧版本无法处理某些文化(在我的场景中,tr-TR)。