0

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?

apc
  • 5,306
  • 1
  • 17
  • 26
  • related: https://stackoverflow.com/questions/67920055/superfluous-runtimes-folder-created-in-output-directory-for-net-5-project – sommmen Feb 09 '22 at 09:04

1 Answers1

1

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/

sommmen
  • 6,570
  • 2
  • 30
  • 51
  • I am using .NET Frameword 4.7.2 not .NET Core using the standard File System publish method. There are not options I can see which match your answer. – apc Feb 09 '22 at 15:53