Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type or namespace 'DocumentFormat' could not be found - only on build - but intellisense shows the type as available

I have downloaded the Power Tools for Open XML from the following website:-

https://powertools.codeplex.com/

I open the solution in VS2012 and then update the references - DocumentFormat.OpenXml and WindowsBase.

The problem is:-

The Visual Studio intellisense shows the namespace when I start typing it at the top of class, but when I build the solution, I get the following error from all the classes where this namespace is used-

The type or namespace 'DocumentFormat' could not be found.

like image 767
teenup Avatar asked Dec 28 '25 19:12

teenup


2 Answers

Maybe someone else still facing issue, as was i.

Go to nuget package manager and search openxml and install from there.

like image 154
donstack Avatar answered Dec 30 '25 09:12

donstack


Depending on your requirements and environment, you need to match the PowerTools and OpenXML SDK versions.

PowerTools 2.2 (which right now is the default download on codeplex) uses DocumentFormat.OpenXml version 2.0.5022.0 which comes with OpenXml SDK 2.0.
This project is built on .NET Framework 3.5.

PowerTools for OpenXML 3.0 version 3.* (also available to download at https://powertools.codeplex.com/releases/view/74771) uses DocumentFormat.OpenXml version 2.5.5631.0 which comes with OpenXml SDK 2.5.
This project is built on .NET Framework 4.0+.

like image 26
Mihai Dinculescu Avatar answered Dec 30 '25 09:12

Mihai Dinculescu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!