Reputation: 127
When publishing Asp.net core mvc application to the folder it creates all .dll files to the output folder
i am using
Visual Studio 2017 15.5.4
Project framework .Net 4.7.1
How to avoid the creating all not required .net framework related .dll?
Thanks in advance
Upvotes: 1
Views: 3428
Reputation: 4923
The publish
command in dotnet core compiles the application and copies all dependencies to the output folder. Since dotnet core is extremely lightweight (as far as the core framework), most (if not all) dependencies are actually NuGet packages. Since these can't be assumed to exist on the machine where the published app is going, they are copied too.
If the publish
command has copied the files to the output directory, they are required by the application to run. You can add options such as --no-dependencies
or --no-restore
, but the resulting published files may not be able to run.
If you are looking to reduce the size of published applications, there is the .NET IL Linker project that might be able to help.
Upvotes: 4