Why is the MathNet.Numerics NuGet package so big?

379 views Asked by At

I recently added MathNet.Numerics through NuGet to my C# solution. The package directory in the solution folder ballooned to about 50 MB! Yet I can simply download the MathNet dll and use only that, which takes up only 1.5 MB. If I want documentation as well, I can include the XML, which is another 3.5 MB.

Am I using Nuget wrong or is this expected behavior? It seems like it is wasting a lot of space.

2

There are 2 answers

1
neverendingqs On

It looks like expected behaviour. It is up to the NuGet package owner to decide how many versions to put in a single package.

You can probably safely delete it, but it'll come back every time you restore the NuGet files. If you are worried about a lot of bloat being included in your build or release, check your .csproj file and make sure you only copy over the MathNet.Numerics.dll version you need.

0
Christoph Rüegg On

The reason the package contains that many editions of the same version is a conflict of interests:

  • We would like to support a wide range of platforms.
  • We would like to leverage advanced features even if they are only available on some of the platforms (usually only on the full .Net framework, like TPL or System.Numerics), for performance but also for compatibility and usability reasons.
  • Avoid downstream dependency nightmares by only publishing a single package per version, including all platforms.

If this is causing you problems, consider to bring this point up with the team in discuss.mathdotnet.com (new) or maybe open an issue in GitHub.

PS: If NuGet doesn't work well for you, we also provide Zip archives you can handle manually and pick exactly what you need.