Say I have a .NET/CLR program Hello.exe (or a DLL Hello.dll) that depends on var
ID: 662141 • Letter: S
Question
Say I have a .NET/CLR program Hello.exe (or a DLL Hello.dll) that depends on various third-party .NET DLLs. I want to ship a single file, without providing an actual "installer", so I am looking for some software that can pack all of the dependencies into the executable, then load them before any of my code starts to run.
I also need it to unconditionally load every DLL that is supplied, not only "on-demand", because some of the types in the DLLs are accessed via reflection and so the class loader will never attempt to explicitly load the DLL and thus call the class loader hook. I don't want to have to add code to my executable if it's possible to do this without any of my own code.
I am using SharpDevelop and .NET Framework 4.0 Full Profile, but the ideal solution to this problem will be IDE-agnostic, and work with .NET 3.0 or later (2.0 would be even better, but let's not get greedy...)
Explanation / Answer
LibZ Container instruments your main assembly with code that unpacks zipped assembly resources from the resource file, and loads them from memory. It claims to work with reflection code as well as strong names, and it doesn't modify the original assembly files in any way, so strong-named references will work fine.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.