Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPPlus The type or namespace name 'OfficeOpenXml' could not be found (are you missing a using directive or an assembly reference?)

Tags:

c#-2.0

epplus

Hi I am using EPPlus to create excel in c# 2.0. I have added the reference of "EPPlus.dll" and also added

using OfficeOpenXML;

but when i am trying to run the solution its giving the follwoing error.

Error:

The type or namespace name 'OfficeOpenXml' could not be found (are you missing a using directive or an assembly reference?)

Warning 1:

The primary reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" or retarget your application to a framework version which contains "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

Warning 2:

The primary reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

Thanks in advance..

like image 271
BABA Avatar asked Oct 08 '13 10:10

BABA


2 Answers

This solved the problem for me :

Errors on EPPlus

just change the target of your proyect from ".Net 4.0 Client Profile" to just ".Net 4.0"

like image 52
Joma Avatar answered Oct 17 '22 23:10

Joma


Rolling back to a prior version worked for me.

like image 31
Missy Avatar answered Oct 17 '22 23:10

Missy