EPPlus icon indicating copy to clipboard operation
EPPlus copied to clipboard

Remove not needed NuGet packages from net5.0

Open pfeigl opened this issue 4 years ago • 2 comments

The EPPlus NuGet Package still references alot of nuget packages, which are not at all needed, as they are natively available in net5.0

From a small test, this should be everything that is actually needed, because all others are nativly available

  <ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
    <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.4.1" />
    <PackageReference Include="System.Drawing.Common" Version="5.0.0"/>
    <PackageReference Include="System.Security.Cryptography.Pkcs" Version="5.0.0" />
  </ItemGroup>

In many situations users won't recognize this, but specifically in enterprise environments where no direct internet is available and all sub-dependencies have to be cached on an internal nuget server, this plays quite a roll.

Thanks, Philipp

pfeigl avatar Jul 15 '21 17:07 pfeigl

On an additional note: I think the dependency on Microsoft.Extensions.Configuration.Json is quite an anti-pattern. A library should ideally not read configuration on it's own and should either get the relevant options provided or at max have a dependency on IConfiguration.

Also the current code only reads appsettings.json, however the hosting application might have a complete differnt understanding from where configuration comes. Or it might have a appsettings.Production.json or similar.

I understand that the code in .NET Framework accessed the AppSettings and while similar problems exist, this is more generic in a way that you don't depend on the exact implementation from where the configuration comes.

Anyways, this is just some random thoughts while I checked the dependencies.

pfeigl avatar Jul 15 '21 17:07 pfeigl

Thanks for the input. We'll have a closer look at this and get back to you.

JanKallman avatar Jul 16 '21 09:07 JanKallman

This is fixed in later versions of EPPlus

JanKallman avatar Feb 20 '24 13:02 JanKallman