This project has moved. For the latest updates, please go here.

ClosedXML and DocumentFormat.OpenXML not Loading

Apr 5, 2012 at 7:49 PM
Edited Apr 5, 2012 at 7:49 PM

Error 253 Could not load file or assembly 'file:///D:\Users\Phillip\Documents\Visual Studio 2010\DocumentFormat.OpenXml.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) D:\Users\Phillip\Documents\Visual Studio 2010\Projects\Ayudanos\SGEN Ayudanos

 

I have referenced the DocumentFormat.OpenXml.dll file, and at the top of the document, I have set it in 'Using DocumentFormat.OpenXml'.  And, when trying to BUILD the application it gives that error above.

 

C# Windows Forms application.  Visual Studio 2010 Ultimate, and VS2011 Beta (both give error).

 

What is causing this?

Coordinator
Apr 6, 2012 at 4:36 AM
Edited Apr 6, 2012 at 4:38 AM

My guess is that VS build doesn't have access to that file/folder.

Try copying the dll to the working folder. If that doesn't work try installing the OpenXML SDK 2.0 and reference the system assembly and not a file.

Apr 6, 2012 at 5:13 AM

When I added reference, per the documentation to the DocumentFormat.OpenXML dll, and did the using clause, it would error.  But, as soon as i removed the reference altogether, boom, Windows Forms application working just fine.

Note, I code in .NET 4.0 and .NET 4.5, so perhaps it is not required in that framework?

Note, distributed apps are working as planned w/o referencing that dll.