Is it possible to remove unused codes / assemblies in .NET?

I have a management library in my application that is slightly larger for the type of application I am developing. The library is more than 2 MB, and I hardly use its functionality, I would say that I use from 5% to 10% of all its functionality.

Is there a way to remove code that my application never uses from the library?

PS: The library is not developed by me, and it is not open source (you can buy the code, though).

EDIT: I posted this because, although it could have been achieved with ILMerge, this is what someone told me in the past ... I tried to use ILMerge but did not work, and I'm not sure I use it correctly ...

+3
source share
6 answers

My boss worked with an obfuscation product that did this by entering the code that was used in the combined assembly. I don’t remember what it was called, maybe it was DotNet Reactor (we used several different products before relying on one).

+1
source

This is what SmartAssembly is called . It's a little pricey, at least for me.

+1
source

, , , , , .

+1

2Mb .

, , , , . , .

0

, , , .

, Reflector , ( ), . , . , .

0

, . mono cecil, , . , ( A B, , A, B)...

0

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


All Articles