From 7295446fe1b8120190ba19a25b41d77f8bdb4be3 Mon Sep 17 00:00:00 2001 From: Yoh Deadfall Date: Fri, 12 May 2023 23:14:39 +0300 Subject: [PATCH] Ignore xmlns without CLR namespace on type resolution --- .../XamlIl/Runtime/XamlIlRuntimeHelpers.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs b/src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs index f8eab5b654..a78af8e35c 100644 --- a/src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs +++ b/src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs @@ -156,10 +156,13 @@ namespace Avalonia.Markup.Xaml.XamlIl.Runtime throw new ArgumentException("Unable to resolve namespace for type " + qualifiedTypeName); foreach (var entry in lst) { - var asm = Assembly.Load(new AssemblyName(entry.ClrAssemblyName)); - var resolved = asm.GetType(entry.ClrNamespace + "." + name); - if (resolved != null) - return resolved; + if (entry.ClrAssemblyName is { Length: > 0 }) + { + var asm = Assembly.Load(new AssemblyName(entry.ClrAssemblyName)); + var resolved = asm.GetType(entry.ClrNamespace + "." + name); + if (resolved != null) + return resolved; + } } throw new ArgumentException(