I'm trying to optimise the size of my application package. Targeting .NET5.0
When I run the following commands:
dotnet new console -o MyConsole
cd MyConsole
dotnet publish -r win-x64 -c release --self-contained
I get a distributable version of my blank console application.
If I navigate to the MyConsole/bin/release/net5.0/win-x64/
folder I see lots of DLLs generated. Those that are not even used by the blank console application.
Are all the DLLs necessary for distribution of my application?
Is there an easy way for me to remove the DLLs that I don't need?
I could remove the DLLs one by one from MyConsole.deps.json
until the executable no longer works but this doesn't seem right.
The MSFT docs mention a larger deployment but is it possible to optimise it? Similar SO