0

So, I want to use a DotNetZip DLL from resource I already loaded it and specified type I created an instance of it , then I used the instance to read the password locked zip file and extract it using the password specified

            Assembly dllassembly = Assembly.Load(block);
            Type type = dllassembly.GetType("Ionic.Zip.ZipFile");
            dynamic instance = Activator.CreateInstance(type);
            using (dynamic zip = instance.Read(@"C:\Users\user\Desktop\output\archive.zip"))
            {
                zip.Password = "123";
                zip.ExtractAll(@"C:\Users\user\Desktop\output\");
            }

I get the following error :

Unhandled Exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Member 'Ionic.Zip.ZipFile.Read(string)' cannot be accessed with an instance reference; qualify it with a type name instead

I tried loading the DLL using appdomain but I don t know how I use the dll after.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Wampro
  • 1
  • 1
  • Does this answer your question? https://stackoverflow.com/questions/2324626/extract-a-zip-file-programmatically-by-dotnetzip-library https://stackoverflow.com/questions/25787566/ionic-zip-extract-only-particular-folder – Sund'er Aug 16 '22 at 11:55
  • My appdomain resolver had an error i fixed it it works now thx anyways – Wampro Aug 18 '22 at 20:40

0 Answers0