当我使用非共享运行时构建Monodroid项目时,Get Encoding失败 [英] Get Encoding fails when I build Monodroid project with unshared runtime

查看:1612
本文介绍了当我使用非共享运行时构建Monodroid项目时,Get Encoding失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Monodroid应用程序中使用DotNetZip库。一切似乎工作正常,当我启用共享运行时构建选项。当我禁用共享运行时,行

I am trying to use the DotNetZip library in my Monodroid app. Everything seems to work fine when I enable the Shared Runtime build option. When I disable Shared Runtime, the line

static System.Text.Encoding ibm437 = System.Text.Encoding.GetEncoding("IBM437");

生成异常(不支持编码名称IBM437)。我已经选中了其他支持的编码列表中的每一个框,但它似乎并没有帮助。任何人都有什么想法?

generates an Exception (Encoding name 'IBM437' not supported). I've checked every box in the "Additional Supported Encodings" list, but it does not seem to help. Anyone have any ideas?

推荐答案

我有同样的问题。

首先,确保您在项目属性中添加了西编码:

First, make sure that you've added the "West" encoding in the project properties:

a href =http://docs.xamarin.com/ios/advanced_topics/internationalization> Xamarin国际化

Xamarin Internationalization

如果这样做不奏效,问题是所需的dll不会被复制到.apk的程序集文件夹。这应该会自动发生,但它不会。我提交了一个错误,因此您可以看到是否已修复:

If that doesn't do the trick, the problem is that the needed dlls are not getting copied to the .apk's assemblies folder. This should happen automatically, but it doesn't. I filed a bug, so you can see if it's been fixed:

Mono for Android / Xamarin Bugzilla

如果没有,这里有一个解决方法适用于我(来自Xamarin):

If not, here is a workaround that worked for me (from Xamarin):


  1. 手动添加对I18N.dll和I18N.West.dll的引用

  2. 将复制本地属性设置为true 'for dlls

  3. 添加以下虚拟代码以将2个dll添加到.apk

  1. Manually Add References to I18N.dll and I18N.West.dll
  2. Set the 'Copy Local' properties to 'true' for both dlls
  3. Add the following dummy code to get the 2 dlls added to the .apk


var ignore = new I18N.West.CP437();

var ignore = new I18N.West.CP437();


  • 设置为无

  • Make sure that 'Linking' is set to 'None'

    希望这有助!

    这篇关于当我使用非共享运行时构建Monodroid项目时,Get Encoding失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆