I am using openxmlpowertool for reading document file with format. It uses reference of DocumentFormat.OpenXml.dll of version 2.6.0.0 but for some functions I need DocumentFormat.OpenXml.dll of version 2.0.5022 for reference, If I add DocumentFormat.OpenXml.dll of version 2.6.0.0 it gives follwing exception
Exception in event log:
Message: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.0.5022.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception type: System.IO.FileLoadException Stack Trace: at CMS.ImportExport.DataExportHelper.ExportToExcel(DataSet dataSet, Stream stream) at CMS.ImportExport.DataExportHelper.ExportData(DataExportFormatEnum format, HttpResponse response)
What I have tried:
I have tried follwing bindingredirct in Web.config,
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml" />
<bindingRedirect oldVersion="2.0.5022.0" newVersion="2.6.0.0"/>
</dependentAssembly>
</assemblyBinding>
I am not able to get publicKeyToken for the DocumentFormat.OpenXml 2.6.0 with
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>sn -T D:\DocumentFormat.OpenXml.dll
Gives "D:\DocumentFormat.OpenXml.dll does not represent a strongly named assembly", so I have not specified