【问题标题】:Portable class library for MonoDroid and MonoTouchMonoDroid 和 MonoTouch 的可移植类库
【发布时间】:2013-02-21 09:44:13
【问题描述】:

我想为 MonoDroid 和 MonoTouch 创建 PCL,以共享代码 AES 加密(RijndaelManaged),但 Visual Studio 不允许我这样做,而是强制我添加所有其他框架,消息如下:

将自动选择以下框架,因为它们支持在您选择的其他框架之间可移植的所有可用功能:适用于 Windows 应用商店应用的 .NET、.NET Framework 4.5、Windows Phone 8。

这些框架不支持 System.Security.Cryptography 命名空间。

MonoDroid 和 MonoTouch 的文件放在 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile78\SupportedFrameworks 中,其中已经包含 .NET for Windows Store apps.xml 、.NET Framework 4.5.xml、Windows Phone 8.xml。

有人可以建议如何将 Mono 框架与其他框架隔离,我是否需要新的配置文件或其他东西。

【问题讨论】:

标签: xamarin.ios xamarin.android portable-class-library


【解决方案1】:

编辑

这现在由安装程序自动完成。您还需要最新版本的 nuget。


实际上,您只需将 xml 文件添加到正确的文件夹即可。神奇的是,会出现一个名为“Mono for Android”的 PCL 配置文件。

文件名:

MonoAndroid,Version=v1.6+.xml

放入文件夹:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks

文件内容:

<?xml version="1.0" encoding="utf-8"?>
<Framework DisplayName="Mono for Android"
  Identifier="MonoAndroid"
  Profile="*"
  MinimumVersion="1.6"
  MaximumVersion="*" />

更多信息请查看 mvvmcross 项目https://github.com/slodge/MvvmCross

【讨论】:

  • 自 1.8 版以来,此功能已过时,因为安装程序会自动引入此功能。并行使用 2012 和 2013 时要小心,因为在我看来 Xamarin-installer 只能集成到一个 VS 中:-(。
  • 呃,没有。您只需在安装程序中手动选择 VS2013 或 VS2012。
【解决方案2】:

Afaik 的 Visual Studio 没有 Xamarin 产品的 PCL 配置文件。所以你不能选择它。

您可能希望尝试启用:.NET >= 4.0.3 和 Silverlight 5 以获得应该与 Xamarin 产品兼容的配置文件。

【讨论】:

    猜你喜欢
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 2012-12-13
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多