Solved: .Net Core publishes lots of files for framework dependent deployment mode

Issue

I have .Net Core 2.1 SDK installed on the machine. When I publish the application with deployment mode = Framework Dependent for Linux, it outputs lots of dlls including the framework dlls. There is a very minor difference in number of files between the Framework Dependent and Self Contained deployment mode.

Solution

I had the project created a while back. At the time of creation, following dependencies were added in project file (*.csproj)

<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />

Replace those two dependencies with the following would give bare minimum files for Framework Dependent deployment mode.

<PackageReference Include="Microsoft.AspNetCore.App" />

Explanation

Microsoft.AspNetCore.App represents the .Net core framework installed on the machine and its assemblies. It assumes that you will have needed runtime installed on the machine in order to use the application.

Share

0 comments

Your email address will not be published. Required fields are marked *