Giter Site home page Giter Site logo

zlib.portable's Introduction

Zlib.Portable is a Portable Class Library port of the Zlib library from the popular DotNetZip project. The code is currently being submitted back to that project, but is mirrored here for reference.

Works on .NET 4.0, 4.0.3, & 4.5, Silverlight 4 & 5, Windows Phone 7.5 & 8, and Windows 8.

Quick start

Install the NuGet package: Install-Package Zlib.Portable, clone the repo, git clone git://github.com/advancedrei/Zlib.Portable.git, or download the latest release.

Bug tracker

Have a bug? Please create an issue here on GitHub that conforms with necolas's guidelines.

https://github.com/AdvancedREI/Zlib.Portable/issues

Twitter account

Keep up to date on announcements and more by following AdvancedREI on Twitter, @AdvancedREI.

Blog

Read more detailed announcements, discussions, and more on The AdvancedREI Dev Blog.

Author

Robert McLaws

Copyright and license

Copyright 2013 AdvancedREI, LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

zlib.portable's People

Contributors

edwinengelen avatar johannesrudolph avatar mattiascibien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zlib.portable's Issues

Cannot install in Visual Studio Express 2012 using Nuget

I cannot install zlib.portable. I get the following error:

Successfully installed 'Zlib.Portable 1.9.2'.
Successfully uninstalled 'Zlib.Portable 1.9.2'.
Install failed. Rolling back...
Could not install package 'Zlib.Portable 1.9.2'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.

I've tried with .NETFramework version 4.0, 2.0 and so on... all gives the same error message.

Where is class ZipFile?!

See documentation http://dotnetzip.codeplex.com/ first example of use:

using (ZipFile zip = new ZipFile())
 {
     // add this map file into the "images" directory in the zip archive
     zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
     // add the report into a different directory in the archive
     zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
     zip.AddFile("ReadMe.txt");
     zip.Save("MyZipFile.zip");
 }

This is not working in your fork.

No strong named version available

Hello,

can a strong named version be provided?

Because if someone (like me) needs to strong name his own assemblies, the referenced assemblies also need to be strong named.

Thanks.

EDIT: also see my pull request under #2

The Portable part isn't really true, but very easy to fix (by deleting 4 lines of code)

Hi,

turns out that when one builds a PCL the symbol SILVERLIGHT isn't defined, so the code with #if SILVERLIGHT directives does not get compiled.

Turns out that there is one place which does use this directive, it's the one in GZipStream class (gets executed as part of static constructor), reproduced here:

    #if SILVERLIGHT || NETCF
            internal static readonly System.Text.Encoding iso8859dash1 = new Ionic.Encoding.Iso8859Dash1Encoding();
    #else
            internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding("iso-8859-1");
    #endif

Seeing how neither SILVERLIGHT nor NETCF are defined for PCL builds, only the #else branch will be used and encoding which doesn't exist in Silverlight (and presumably compact framework too) will be baked in the final assembly, which will crash the static constructor of GZipStream.

This should be easy to fix by simply never using platform's built-in Encoding but always using Iso8859Dash1Encoding especially since the encoding here is just a no-op encoding, there's no question of performance or correctness.

So could you please simply remove the #if/#else/#endif and just use Iso8859Dash1Encoding which should work on all platforms? I've checked and there are no other places in the code which reference SILVERLIGHT, so this should be the only thing preventing this library from working on Silverlight.

After the fix, would you be so kind to push the new version to NuGet?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.