From d106e21d5b4d18822198e807f8686f5ecb8f63e0 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Mon, 18 Mar 2019 11:25:47 +0100 Subject: [PATCH] [X] recover from memberaccessEx - fixes #5589 --- Xamarin.Forms.Xaml/CreateValuesVisitor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs index b74c63b4a..88e71abb5 100644 --- a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs +++ b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs @@ -94,8 +94,8 @@ namespace Xamarin.Forms.Xaml try { value = Activator.CreateInstance(type); } - catch (TargetInvocationException tie) { - value = XamlLoader.InstantiationFailedCallback?.Invoke(new XamlLoader.CallbackTypeInfo { XmlNamespace = node.XmlType.NamespaceUri, XmlTypeName = node.XmlType.Name }, type, tie) ?? throw tie; + catch (Exception e) when (e is TargetInvocationException || e is MemberAccessException) { + value = XamlLoader.InstantiationFailedCallback?.Invoke(new XamlLoader.CallbackTypeInfo { XmlNamespace = node.XmlType.NamespaceUri, XmlTypeName = node.XmlType.Name }, type, e) ?? throw e; } } }