Skip to content

Xamarin.Android 9.2.0.3

Compare
Choose a tag to compare

Xamarin.Android 9.2.0.3 was released to the Xamarin Preview updater channel of Visual Studio 2019 for Mac Preview.

Issues Fixed

Application Mono Framework Behavior on Device and Emulator

This version of Xamarin.Android updates the Mono 5.18 runtime and class libraries from Commit 163f45d8 to Commit 5ad371da, adding 1 new commit:

  • GitHub PR 13106: Make System.dll internals visible to Mono.Android. This is a first step toward resolving the known issue GitHub 2679. Note that the issue is not yet resolved in Xamarin.Android 9.2.0.3 because the corresponding change to take advantage of the new visibility of the System.dll internals is not yet in place.

Known Issues

  • GitHub 2679: Attempting to call new X509Certificate(bytes) can fail with "System.PlatformNotSupportedException: Cannot get `ISystemDependencyProvider`." on device or emulator. This issue depends on the order of type instantiations and method calls.

    Workaround: Invoke the non-public Mono.SystemDependencyProvider.Initialize() method at some point in your app before the first use of X509Certificate. One option is to use reflection to locate and invoke the method:

    var t = Type.GetType("Mono.SystemDependencyProvider, System", throwOnError: true);
    var m = t.GetMethod("Initialize", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
    m.Invoke(null, null);

    Another approach is to use some part of the public API surface that invokes the method behind the scenes. For example, the following line is sufficient:

    new X509Certificate2(new X509Certificate());