ClosedXML - Failed to load file or assembly

I am trying to use ClosedXML to create excel documents in an application, but when I try to run it, I get can not load the file or assembly server error.

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. 

I saw several solutions for this, which include changing the "Copy local" value for the .dll in its properties and adding the assembly directly to the web.config file.

I am using Visual Studios 2010 and the dll properties do not include the copy local entry. Then, when I enter the next build in the web configuration, I still get the server error message. I got the assembly from the error message.

  <add assembly="ClosedXML, Version=0.76.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b"/> 
+6
source share
4 answers

After a crazy search for answers and finally sending a question, I came across the simplest answer, and as soon as I referenced the additional .dll, everything worked correctly.

To use ClosedXML, you must reference DocumentFormat.OpenXml.dll:

DocumentFormat.OpenXml.dll for NET 4.0 +

+5
source

I have the same problem, but I just added the nuget package and made sure it is listed correctly in my project

 using ClosedXML.Excel; 

Then I can access the excel file with

 var wb = new XLWorkbook(MyExcelFile); 
+1
source

I have the same problem. I am looking for "ClosedXML.Signed" in Nugget, updating "DocumentFormat.OpenXml" and it works!

0
source

OpenXMLSDK2.5 is installed and the problem is resolved.

https://www.microsoft.com/en-us/download/details.aspx?id=30425

0
source

Source: https://habr.com/ru/post/1241061/


All Articles