Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I'm getting this exception whenever I try to open a zip file with DotNetZip. This used to to work previously - will update bug when I find the version that works again.
System.TypeInitializationException: The type initializer for 'Ionic.Zip.ZipFile' threw an exception. ---> System.NotSupportedException: No data is available for encoding 437.
at System.Text.Encoding.GetEncoding (Int32 codepage) [0x00214] in /Library/Frameworks/Xamarin.Mac.framework/Versions/184.108.40.206/src/mono/external/referencesource/mscorlib/system/text/encoding.cs:520
at System.Text.Encoding.GetEncoding (System.String name) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/220.127.116.11/src/mono/external/referencesource/mscorlib/system/text/encoding.cs:653
at Ionic.Zip.ZipFile..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at ZipTest.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00006] in /Users/greg/Projects/Scratch/ZipTest/ZipTest/AppDelegate.cs:18
at at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string)
at AppKit.NSApplication.Main (System.String args) [0x00041] in /Users/builder/data/lanes/2097/815e5d67/source/maccore/src/AppKit/NSApplication.cs:94
at ZipTest.MainClass.Main (System.String args) [0x00007] in /Users/greg/Projects/Scratch/ZipTest/ZipTest/Main.cs:10
1. Create a new X.Mac app
2. Change Framework to Xamarin.Mac .NET 4.5 Framework
3. Add DotNetZip nuget
4. Add a line in AppDelegate.DidFinishLaunching like the following
var zip = new ZipFile (@"/Users/greg/Test.zip");
For reference, I created the zip using Mac's "Compress Items" command in Finder. Same result on both Yosemite and El Capitan.
=== Xamarin Studio ===
Version 5.10 (build 871)
Installation UUID: 4c80d01a-1a3a-4aa8-88c0-c96149a20e81
Mono 4.2.1 (explicit/6dd2d0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402010102
=== Xamarin.Profiler ===
=== Apple Developer Tools ===
Xcode 7.1.1 (9081)
=== Xamarin.iOS ===
Version: 18.104.22.168 (Business Edition)
Build date: 2015-11-12 13:05:39-0500
=== Xamarin.Android ===
Version: 22.214.171.124 (Business Edition)
Android SDK: /Users/greg/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.3.4
SDK Platform Tools Version: 23
SDK Build Tools Version: 22.0.1
Java SDK: /usr
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 126.96.36.199 (Business Edition)
=== Build Information ===
Release ID: 510000871
Git revision: 4e9c5abb5ffdae12ba02ac49da83f8b2011dbb88
Build date: 2015-11-12 06:02:54-05
Xamarin addins: 55007ed0e56436f385d8e26394a45be563abc7e8
Build lane: monodevelop-lion-cycle6
=== Operating System ===
Mac OS X 10.10.5
Darwin Kryten.local 14.5.0 Darwin Kernel Version 14.5.0
Tue Sep 1 21:23:09 PDT 2015
X.M 2.02 creates the instance of the ZipFile as expected.
*** Bug 36318 has been marked as a duplicate of this bug. ***
^ appears to be an identical bug, though it is using System.IO.Compresion.ZipFile.ExtractToDirectory instead of DotNetZip.
Copying these files into the mono bundle "fix" the problem:
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/gac/I18N/188.8.131.52__0738eb9f132ed756/I18N.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/gac/I18N.West/184.108.40.206__0738eb9f132ed756/I18N.West.dll
^ is not a suggested work around. If your version of mono doesn't exactly match the one bundled with XM, then "bad things" may occur at runtime.
The XM 4.5 profile needs to include I18N.dll and friends apparently.
Apparently we _do_ ship those assemblies, just mmp isn't pulling them in.
A valid work around is to add the following lines to your csproj:
Or you can add a reference in XS and browse to that location manually.
thanks for the workaround.
Could you take a look at this one. Mono seems to be misbehaving.
This looks like a case of the new framework code using the new codepage.
As discussed on the mailing list, I think that we want is to remove the dependency on this codepage, as opposed to adding the codepage decoder.
I take it back, this is not the reference source code, this is embedded into Ionic's zip library.
The correct solution is just to bundle the I18N's West assemblies. If we have a bug bundling them, we should fix that, but it is not a Mono issue.
There is no bug bundling them if you check the correct box in the project configuration, it will pull in West for you and all will be well.
Now, if that should be the default, and/or we should a better error message are open questions.
I think the default is fine, and we should just make the answer googable.
Working with documentation to get this posted somewhere. Will close bug when it is public.
This is now documented here:
I'm going to close as answered, as people who run into this case will be instructed to just enable the west checkbox.