0.86 Sequence contains more than one matching element
See original GitHub issueAfter i upgrade ClosedXML from 0.85 to 0.86 i can’t save my Workbooks anymore. When i downgrade to 0.85 everything works again.
Stacktrace:
System.InvalidOperationException
Sequence contains more than one matching element.
StackTrace:
bei System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
bei ClosedXML.Excel.XLWorkbook.GenerateWorkbookStylesPartContent(WorkbookStylesPart workbookStylesPart, SaveContext context) in C:\Git\ClosedXML\ClosedXML\Excel\XLWorkbook_Save.cs:Zeile 2610.
bei ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document) in C:\Git\ClosedXML\ClosedXML\Excel\XLWorkbook_Save.cs:Zeile 252.
bei ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType, Boolean validate) in C:\Git\ClosedXML\ClosedXML\Excel\XLWorkbook_Save.cs:Zeile 104.
bei ClosedXML.Excel.XLWorkbook.Save(Boolean validate) in C:\Git\ClosedXML\ClosedXML\Excel\XLWorkbook.cs:Zeile 452.
bei ClosedXML.Excel.XLWorkbook.Save() in C:\Git\ClosedXML\ClosedXML\Excel\XLWorkbook.cs:Zeile 432.
And my Code
var wb = new XLWorkbook(FILEPATH);
wb.Save(); // Just Opening und Saving is Enough.
I hope the Stacktrace is enough. Happens with different Excel Files on my side. If you need more Information, just ask.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Sequence contains more than one element
The problem is that you are using SingleOrDefault . This method will only succeed when the collections contains exactly 0 or 1 element....
Read more >"Sequence contains more than one matching element" error ...
Hello @petercli ,. Welcome to the community! It seems like you are using an old .NET ms build scanner which is no longer...
Read more >Sequence contains more than one matching element
Sequence contains more than one matching element ... SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) at Microsoft.PowerBI.
Read more >"Sequence contains more than one matching element" on ...
The issue is caused if the Sitefinity project is a multisite project and on the target and the source projects there are different...
Read more >Sequence contains more than one matching element
Some tables from Import mode, and a dataset. When I refresh, I get this error: Sequence contains more than one matching element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cloned it and yep, it works with the develop Branch 👍
The PR has been merged into the
develop
branch. I’d appreciate it if you could pull thedevelop
branch and check that it solves your issue. Thanks.