question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.86 Sequence contains more than one matching element

See original GitHub issue

After 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:closed
  • Created 7 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
BenKmanncommented, Mar 20, 2017

Cloned it and yep, it works with the develop Branch 👍

0reactions
igiturcommented, Mar 20, 2017

The PR has been merged into the develop branch. I’d appreciate it if you could pull the develop branch and check that it solves your issue. Thanks.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found