Reputation: 5566
I have 2 projects, an ASP MVC project and an ASP Web API project using .NET Framework 4.7.2
From a coding perspective both of these project types are very similar.
Yet the MVC project publishes to <100MB and the API project to 500MB+, despite the MVC project containing numerous JS libraries and other content.
This seems to be down to a folder the Web API project includes called "runtimes". Is this folder necessary, can it be optionalised, are there some optimisation options I can set?
Upvotes: 0
Views: 173
Reputation: 7648
This is the framework which is published because of the settings in your publish profile.
Publishing your app as self-contained produces an application that includes the .NET runtime and libraries, and your application and its dependencies. Users of the application can run it on a machine that doesn't have the .NET runtime installed. Publishing your app as framework-dependent produces an application that includes only your application itself and its dependencies. Users of the application have to separately install the .NET runtime.
https://learn.microsoft.com/en-us/dotnet/core/deploying/
Upvotes: 1