Hello I am currently trying to resolve an issue regarding a software I am developing.
What I want to achieve: Load a dll into the memory stream from a byte[] without WriteAllBytes (meaning that I want to avoid touching the disk).
I have tried plenty of methods but failed. I think that I successfully did load the byte[] into the memory, but my compiled executable is still looking for it to be loaded from the disk instead of the memory. How do I make it to load it from the memory in order to be able to be utilized?
Let's get into the code.
WebClient client = new WebClient();
string b64strbin = client.DownloadString("URL OF A FILE WHERE IT CONTAINS BYTE[]"); // this will download the string and store it to a variable.
byte[] decode = Convert.FromBase64String(b64strbin); // just decode it from base64 back to byte[]
byte[] packed = QuickLZ.decompress(decode); // decompressed dll byte[] (dont mind about this)
Assembly.Load(packed); // here i am loading the byte[] to the memory but still i get an exception
//methods that require the dll in order to run
Console.Read();