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()
74
74
[ MemberNotNull ( nameof ( _ignoresAccessChecksFromAttribute ) ) ]
75
75
static void InitializeSre ( )
76
76
{
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
+
77
86
if ( _sreTypeSystem == null )
78
87
_sreTypeSystem = new SreTypeSystem ( ) ;
79
88
if ( _sreBuilder == null )
Original file line number Diff line number Diff line change 10
10
11
11
namespace Avalonia . Markup . Xaml . UnitTests
12
12
{
13
- static class XamlLoaderInit
14
- {
15
- [ ModuleInitializer ]
16
- public static void Init ( )
17
- {
18
- var _ = typeof ( Binding ) ;
19
- }
20
- }
21
-
22
13
public class XamlTestBase : ScopedTestBase
23
14
{
24
15
public XamlTestBase ( )
You can’t perform that action at this time.
0 commit comments