Embedding libraries in .DLL's

Jul 9, 2013 at 11:42 AM
Hi Krashan

I have another query - is it possible to embed either a DLL or a .libz into another .DLL? or only into .exe files?
Jul 9, 2013 at 12:41 PM
Edited Jul 9, 2013 at 12:49 PM
(Last time I read your comment on my phone then replied in wrong thread)

It absolutely is and it is used to distribute six versions (Safe, Unsafe, C++/CLI 32, C++/CLI 64, MixedMode C++ 32, MixedMode C++ 64) of LZ4 compression in one assembly.

Check out https://lz4net.codeplex.com/

NOTE: Something you should know. If DLL is merged with LibZ and another DLL is merged with LibZ and EXE is also merged with with LibZ (and puts all the previously merged DLL inside EXE) it will... still work :-)
Although, technically there will be 3 resolvers and they will SHARE data. It you packed assembly A with assembly X embedded, and assembly B with assembly X embedded, when B loads X it is not guaranteed which one it will get. Maybe the one which was packed with A. It won't be a problem when they have strong names - it will load the right one (that's why I have sign and sign-and-fix in LibZ), but if they don't and for some reason X is A is in different version than the one in B, you may have problem.