ASP.NET Core publish produces lots of DLLs in the published folder, why? ASP.NET Core publish produces lots of DLLs in the published folder, why? windows windows

ASP.NET Core publish produces lots of DLLs in the published folder, why?


Dotnet core tend to be very minimal as opposed to the previous versions of .net framework.

In dotnet core, the main purpose was making the core framework as small as possible and if you need more stuff, bring it in through NuGet packages.

So, many dependencies that used to be available in the framework are now moved to the NuGet packages and as you know there is a chain of dependencies in NuGet packages, so we will end up with so many libraries in our publish output, which is fine.

Another point being, most of the time, we're using project templates with too many dependencies that might not be needed whatsoever. So we can either start with a very minimal template and add needed stuff in it, or remove useless stuff from a more chuncky template.


I had a similar issue. When my local computer was upgraded from Net Core 2.0 to 2.1, my Core We Application which references a NetStandard application started publishing all DLL's in all referenced projects. I migrated my Core 2.0 application to 2.1 to match the highest version of SDK installed on my local and I could see my issue is now resolved. Publishing from the migrated(upgraded) application produced only the required DLL's. Hope this helps.