Best practice to reduce bloat with a helper library for multiple projects

Well, I have an application that I developed, call him Project A. Functions that are not found in the Microsoft .NET Framework, I put in a shared library, called MyLib.

Now, projects B, C, D, E also use MyLib (many projects). My "MyLib" is slowly added over 4 or 5 years.

I now have MyLib. Well, 5 MB, but I call it huge.

The question is: should I, can I, and how can I compile my projects with MyLib , but delete unused functions, classes, etc. from MyLib ? This will pretty hit that my Hello World applications, which use 1 tiny static function from MyLib, lead to 6MB HelloWorld.exe (after ilmerge).

FOSS> Payware.

+3
source share
4 answers

What you are looking for is Mono Linker and the source code is on GitHub . A standalone tool is often not used, but as one of the steps of their iPhone compiler, I think libs are solid.

, . , , .

+3

, . , . .

" " - mylib .

" " . .net framework. dot.dll

0

.Net-. MyLib Text-, - .

, , . , DLL.

, VS , , , MyLib, DLL. . MyLib DLL.

0

AFAIK, it only hurts: divide your library into functional parts. This will mean going through the various projects that consume MyLib, and adding the appropriate new links, but I do not see another way. And this is also the hard part: defining the boundaries of these functional units. If you are not careful, you can end up (for example, referring to 6 different assemblies where there used to be only one, which worsened the situation along the way.

Evaluate very carefully what your projects use and do not use before taking this path.

0
source

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


All Articles