How to make .net build size as small as possible?

I have a .net assembly that contains a data access code (a bunch of typed datasets and helper classes) that is quite large on disk (~ 2.5 MB). What can I do to understand why it is so big and make it smaller?

+3
source share
2 answers

You can reduce the amount of information in the assembly. If typed datasets are not always used, moving the various to separate assemblies referenced by one central assembly can be an effective approach. Then, the runtime will load assemblies only as needed.

Otherwise, you can do a little without actually reducing the amount of code in the assembly itself. The obfuscator may reduce the size a bit, as it will reduce the names, but this is likely to be a minor improvement.

+2
source

MS ILMerge can create small assemblies (not too sure how it combines duplicate ads, etc.)? worth a look i think

+1
source

Source: https://habr.com/ru/post/1716813/


All Articles