EPPlusSoftware / EPPlus

EPPlus-Excel spreadsheets for .NET
https://epplussoftware.com
Other
1.8k stars 274 forks source link

Remove not needed NuGet packages from net5.0 #437

Closed pfeigl closed 8 months ago

pfeigl commented 3 years ago

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 commented 3 years ago

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.

JanKallman commented 3 years ago

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

JanKallman commented 8 months ago

This is fixed in later versions of EPPlus