New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Could not load type 'DocumentFormat.OpenXml.Packaging.IdPartPair'] #2220
Comments
I also have just started to get this error when I call XLWorkbook SaveAs:
|
Same here. I tried to update to preview version and the problem still happens. I downgraded from dotNet8 to dotNet6 and it works fine. |
I think that I also had DocumentFormat.OpenXml version 3.0.0 |
In my case, I found a solution, I lowered the version of Document.OpenXML to version 2.16.0, I no longer got the error. Hope everyone will have success with this solution |
@nsnhan127 can we keep this issue open or make another issue specficially for OpenXML 3.0 support? I had to downgrade OpenXML referenced in one project because it was incompatible with ClosedXML (tried the latest preview build of ClosedXML and same issue) referenced in another project. My issue specifically was this call: Which throws the MissingMethodException:
Downgrading OpenXML, while it may fix the issue, isn't a long-term solution. |
@donalddps ok, I reopened this issue for everyone who have a better solution for any case. |
Hello everyone. I have exactly the same problem. We just upgraded to |
what's the base reason about this issue? |
We have the same issue. Downgrading openXML solved it. We're also running on .NET 8. |
Also facing the same issue. But downgrading OpenXML isn't an option as it's a peer dependency. I'd guess updating the dependency to 3.0.0 would solve it: |
Would annotating compatible dependency version of OpenXml in ClosedXML help?
What this means ClosedXML accepts OpenXml 2.16.0 and up, but not 3.0.0 and higher. This should prevent it using 3.0.0 referenced by another dependency. source |
…yet. Without explicit range of accepted versions, there is no warning if user has explicitely declared dependency on both v3.0 and ClosedXML 0.102*.
…yet. Without explicit range of accepted versions, there is no warning if user has explicitely declared dependency on both v3.0 and ClosedXML 0.102*.
…yet. Without explicit range of accepted versions, there is no warning if user has explicitely declared dependency on both v3.0 and ClosedXML 0.102*.
I have published a package 0.102.2 with explicit allowed version per @BieleckiLtd suggestion. ClosedXML isn't yet compatible with 3.0, so users will get a warning if they depend on it and it's sufficient stopgap for now. I have also pinned the issue. |
thanks @jahav What are the blockers for OpenXml 3.0.0 ? Is there an issue for that somewhere? |
…yet. Without explicit range of accepted versions, there is no warning if user has explicitely declared dependency on both v3.0 and ClosedXML 0.102*.
I still get an exception. I use
|
@simonziegler And you are running incompatible major version for 0.102.2, as described in the issue (#2220 (comment)). Update to OpenXML SDK 3.0 has been merged in #2248 for 0.104, so I am closing the issue. |
Many thanks. I'll wait for this to be available on Nuget and will try again then. Much appreciated, Simon |
I still have the problem using 0.104.0-preview2 is this right? |
Yes me too! |
|
Is there an estimation for the next nuget release? |
@mariojsnunes That is a self-imposed blocker, because you also updated OpenXML-SDK to a different major version. OpenXML SDK 2.* works fine on .NET8. As for when, I am in middle (hopefully two thirds) of pivot tables refactoring and it doesn't go well. I hoped it would be done by now... |
unfortunately for us it was another 3rd party dependency that updated OpenXML-SDK. |
Downgrade "DocumentFormat.OpenXml" to 2.16.0 works for me |
…l v3.0.0 yet. Without explicit range of accepted versions, there is no warning if user has explicitely declared dependency on both v3.0 and ClosedXML 0.102*.
Is there an estimation for the next nuget release? |
I just uninstalled the DocumentFormat.OpenXML package and ClosedXML works fine. I'm very confused. I thought it was a dependency? I am sure it was required when I initially installed ClosedXML. I've tried removing it and reinstalling and it doesn't require OpenXML. If it's no longer a dependency why does it show DocumentFormat.OpenXML >=2.16.0 && < 3.0.0 in the list of dependencies? |
Just ran into this issue as well after upgrading OpenXml to 3.02. Any estimate on when this will be pushed to a release? Thanks |
ClosedXML depends on DocumentFormat.OpenXML and will bring it as a transitive package. This means you do not need to include DocumentFormat.OpenXML in your project yourself. The problem arises when YOUR project also directly depends on DocumentFormat.OpenXML; in that case, you must pull the same version that ClosedXML depends on. As a reminder, the latest ClosedXML (0.102.2) depends on DocumentFormat.OpenXML (>= 2.16.0 && < 3.0.0). |
Ah, many thanks for the explanation. I get it now. |
In my project, I use 2 packages: ClosedXML ver 0.102.1 and DocumentFormat.OpenXml ver 3.0.0. I encountered an error when using ClosedXML to create an excel file (image below)
and error is : "Could not load type 'DocumentFormat.OpenXml.Packaging.IdPartPair' from assembly 'ClosedXML, Version=0.102.1.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b' due to value type mismatch."
How can i fix this issue ?
The text was updated successfully, but these errors were encountered: