File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
src/Markup/Avalonia.Markup.Xaml.Loader
tests/Avalonia.Markup.Xaml.UnitTests Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ public static void DumpRuntimeCompilationResults()
7474 [ MemberNotNull ( nameof ( _ignoresAccessChecksFromAttribute ) ) ]
7575 static void InitializeSre ( )
7676 {
77+ // SRE backend doesn't load assemblies, unless they are already in the memory.
78+ // At the very least, we should make sure that assemblies necessary for `AvaloniaXamlIlWellKnownTypes` are loaded.
79+ // Root `Avalonia.Controls`.
80+ GC . KeepAlive ( typeof ( Avalonia . Controls . Control ) ) ;
81+ // Root `Avalonia.Markup`.
82+ GC . KeepAlive ( typeof ( Avalonia . Data . Binding ) ) ;
83+ // Root `System.ObjectModel`
84+ GC . KeepAlive ( typeof ( System . ComponentModel . TypeConverterAttribute ) ) ;
85+
7786 if ( _sreTypeSystem == null )
7887 _sreTypeSystem = new SreTypeSystem ( ) ;
7988 if ( _sreBuilder == null )
Original file line number Diff line number Diff line change 1010
1111namespace Avalonia . Markup . Xaml . UnitTests
1212{
13- static class XamlLoaderInit
14- {
15- [ ModuleInitializer ]
16- public static void Init ( )
17- {
18- var _ = typeof ( Binding ) ;
19- }
20- }
21-
2213 public class XamlTestBase : ScopedTestBase
2314 {
2415 public XamlTestBase ( )
You can’t perform that action at this time.
0 commit comments