Error: System.IO.FileNotFoundException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

AjayP
 
on Aug 22, 2016 04:15 AM
6299 Views

Ref : http://www.aspsnippets.com/Articles/Export-data-from-SQL-Server-to-Excel-in-ASPNet-using-C-and-VBNet.aspx

Hi,
The above solution working fine in local, but showing the below error on click of button to export the excel on Godaddy hosting.

Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
AjayP
 
on Aug 28, 2016 10:46 PM

I've added the assemblies reference of dll in web.config file. Now it's working fine.