I am trying to make a single file executable in C#. The program does not have alot of code, yet the output is around 50mb even when I am using PublishTrimmed. Is there a way I can decrease the size of this? Thanks.
Configuration: Debug | Any CPU Target Framework: net core 3.1 (windows) Target Runtime: win x-64 Deployment Mode: Single File / Self Contained
Set the configuration to
Releaseinstead ofDebug.You can disable
Self Containedwhen the user has the appropriate.net runtimeinstalled. This can save a lot of space.If your
execontains resources such as videos, it may not be able to shrink.Self Containedalso has many benefits and saves a lot of trouble, you can check the official documentation for details.