OpenXML 2.5 not totally compatible to 2.0?

Dec 4, 2012 at 1:49 PM

Hi, i just discovered that MS released version 2.5 of the OpenXML SDK. I just tried to replace the DocumentFormat.OpenXML.dll with the new one.

My ClosedXML based program does not like it .... :(

System.TypeLoadException: Could not load type 'DocumentFormat.OpenXml.Spreadsheet.SmartTags' from assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=
neutral, PublicKeyToken=31bf3856ad364e35'.
   at ClosedXML.Excel.XLWSContentManager..ctor(Worksheet opWorksheet)
   at ClosedXML.Excel.XLWorkbook.GenerateWorksheetPartContent(WorksheetPart worksheetPart, XLWorksheet xlWorksheet, SaveContext context)
   at ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document)
   at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath)
   at ClosedXML.Excel.XLWorkbook.Save()

Best Regards,


Dec 4, 2012 at 4:43 PM

I'll skip the v2.5 because it doesn't really offer anything besides new Office 2013 tags and it's .NET 4.0 only.

Dec 9, 2012 at 9:00 AM

Just found in the Documentation that Smarttags are deprecated with Excel 2010. Thats the reason why SDK2.5 does not support it any longer. At least it will become an issue in the future.

I havent found any information about Smarttags within the ClosedXML project. I assume that you don't support it anyway, right?
If thats the case, it could be removed, right now?
Oct 2, 2013 at 10:31 AM
Other than dropping back to OpenXML 2.0, is there a way around this issue?
Seems strange that a feature no longer supported in the base SDK is causing a break if ClosedXML doesn't support the feature in the first place.

Oct 3, 2013 at 12:59 AM
I've just tried compiling against OpenXML SDK 2.0 (1.0) and I still get the same error. Very confused.
I'm just going to have to pull down the ClosedXML source and remove the SmartTag reference.
Oct 3, 2013 at 1:28 AM
My bad. I feel I am always trying to catch up with latest 'features' of .NET...
Despite specifically installing OpenXML 2.0 (1.0) the same smart tag error would appear and reference v2.5 of the assembly.
Turns out I had a redirect in my web.config as follows:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="" newVersion="2.5.5631.0" />
as per the "Could not load file or assembly" error page:
LOG: Redirect found in application configuration file: 2.0.5022.0 redirected to 2.5.5631.0.
Oct 3, 2013 at 3:57 AM
I just updated the Nuget package to pull the right DocumentFormat.OpenXml.dll

Sorry about that.
Marked as answer by SeanKilleen on 10/7/2013 at 12:55 PM
Feb 13 at 7:54 AM
About DocumentFormat.OpenXml and OpenXML SDK, and ClosedXML

Note: I have send message in nuget, for better support, I post here again.

DocumentFormat.OpenXml 2.5.0 uses Microsoft OpenXML SDK 2.5

Here Open XML SDK 2.0.0

ClosedXML has dependency DocumentFormat.OpenXml version 2.0.5022.0 (Open XML SDK 2.0.0 )


1.) ClosedXML will be available for Microsoft OpenXML SDK 2.5 (DocumentFormat.OpenXml 2.5.0) ?

2.) will be available for OpenXML SDK 2.5?