This project is read-only.

TypeInitializationException appears in Silverlight 5 OOB (Out Of Browser)

Aug 17, 2011 at 10:12 AM


I'm a fan of DotNetZip, so now I move my application to Silverlight 5 (beta) OOB (SL5 OOB unrestricted access local file system)

I have use Ionic.Zip for Silverlight (version

Here's my code:

if (Application.Current.HasElevatedPermissions)
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Multiselect = false;

                if (ofd.ShowDialog() == true)
                    string zipFilePath = ofd.File.FullName;

                    Stream stream = ofd.File.OpenRead();

                    ZipFile zip = ZipFile.Read(stream);

                    zip.Password = "samplepassword";



The error appears at "ZipFile zip = ZipFile.Read(stream)", the same error when I replace stream with file path of my zip file

TypeInitializationException was unhandled by user code


Arguments: Ionic.Zip.ZipFile

Could you post the example how to use in Silverlight OOB? Thank you so much.