1

can we reference dll of different versions in same application...Actullay currently some uses DocumentFormat.OpenXml.dll is of version 2.0.5022.0,but I want to use the higer version 2.6.0.0 of it.. It throws exception for the "Export to excel" function I have tried following redirecting in web.config

   <dependentAssembly>
     <assemblyIdentity name="DocumentFormat.OpenXml" />
      <bindingRedirect oldVersion="2.0.5022.0" newVersion="2.6.0.0"/>
    </dependentAssembly>       
  </assemblyBinding>

But it still throws 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)

I need updated version of DocumentFormat.OpenXml.dll i.e version 2.6.0.0 for my functionality implementation How can I resolve it for "Export to Excel"

  • Possible duplicate of [Using two DLLs with same name and same namespace](http://stackoverflow.com/questions/4445188/using-two-dlls-with-same-name-and-same-namespace) – noscreenname Aug 17 '16 at 13:38
  • You might find this useful https://support.microsoft.com/en-us/kb/837908 – khargoosh Aug 18 '16 at 05:09

0 Answers0