Browse Source

Ignore xmlns without CLR namespace on type resolution

pull/11347/head
Yoh Deadfall 3 years ago
parent
commit
7295446fe1
  1. 11
      src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs

11
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); throw new ArgumentException("Unable to resolve namespace for type " + qualifiedTypeName);
foreach (var entry in lst) foreach (var entry in lst)
{ {
var asm = Assembly.Load(new AssemblyName(entry.ClrAssemblyName)); if (entry.ClrAssemblyName is { Length: > 0 })
var resolved = asm.GetType(entry.ClrNamespace + "." + name); {
if (resolved != null) var asm = Assembly.Load(new AssemblyName(entry.ClrAssemblyName));
return resolved; var resolved = asm.GetType(entry.ClrNamespace + "." + name);
if (resolved != null)
return resolved;
}
} }
throw new ArgumentException( throw new ArgumentException(

Loading…
Cancel
Save