Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPPlus missing dependency

Tags:

c#

epplus

I added EPPlus and usage of OfficeOpenXml to my project. However, when I run my project I get this errors and warning :

Warning :

The referenced assembly "EPPlus" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

Errors :

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

Can someone help me figure it out?

like image 858
Morilog Avatar asked Jun 03 '13 23:06

Morilog


1 Answers

The problem, like the warning says, is that EPPlus references an assembly (System.Web) that is not in the .NET v4.0 Client Framework. You might want to target the full .NET v4.0 instead of the Client framework.

Update This has step-by-step instructions on changing the target framework for a project: http://msdn.microsoft.com/en-us/library/vstudio/bb398202.aspx In your project that's trying to reference EPPlus, instead of .NET 4.0 Client Profile, choose .NET 4.0.

like image 66
Tim S. Avatar answered Nov 03 '22 18:11

Tim S.