Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native AOT Crashes on Startup #122

Closed
cybertron-cube opened this issue Jul 26, 2023 · 2 comments
Closed

Native AOT Crashes on Startup #122

cybertron-cube opened this issue Jul 26, 2023 · 2 comments

Comments

@cybertron-cube
Copy link

Using 11.0.0 release and building with PublishAot set to true, the text : https://github.com in MarkDownScrollViewer causes the application to crash. It seems any colon followed by a web link causes this crash when compiling with AOT.

Starting a new Avalonia project and putting this
image
in MainWindow.axaml along with setting PublishAot to true is what I did to produce the exception below

Exception Details
System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Assembly.GetCallingAssembly() + 0x5b
at Markdown.Avalonia.EmojiTable.LoadTxt() + 0x5c
at Markdown.Avalonia.EmojiTable..cctor() + 0x1e
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xc6
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x167
at
System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*, IntPtr) + 0xd
at Markdown.Avalonia.EmojiTable.TryGet(String, String&) + 0x19
at Markdown.Avalonia.Markdown.DoTextDecorations(String, Func`2) + 0x1e4
at Markdown.Avalonia.Markdown.g__RunSpanRest|74_0(String, Int32, Int32, Int32, List`1) + 0x159
at Markdown.Avalonia.Markdown.PrivateRunSpanGamut(String) + 0x4d
at Markdown.Avalonia.Markdown.d__78.MoveNext() + 0x1a4
at System.Collections.Generic.List`1.InsertRange(Int32, IEnumerable`1) + 0x120
at Markdown.Avalonia.Markdown.g__RunBlockRest|73_0(String, Int32, Int32, ParseStatus, Int32, List`1) + 0x154
at Markdown.Avalonia.Markdown.PrivateRunBlockGamut(String, ParseStatus) + 0x308
at Markdown.Avalonia.Markdown.Transform(String) + 0x3c
at Markdown.Avalonia.MarkdownScrollViewer.UpdateMarkdown() + 0x3b
at MpvTest.Views.MainWindow.!XamlIlPopulate(IServiceProvider, MainWindow) + 0x22e
at MpvTest.Views.MainWindow.InitializeComponent(Boolean) + 0x14
at MpvTest.App.OnFrameworkInitializationCompleted() + 0x41
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder, String[], ShutdownMode) + 0x4b
at MpvTest.Program.Main(String[]) + 0x21
whistyun added a commit that referenced this issue Jul 29, 2023
supports AOT(refs #122) and fixes syntaxhights(refs #121)
@whistyun
Copy link
Owner

Markdown.Avalonia 11.0.1 has be released.
This version fixes the issue.

@cybertron-cube
Copy link
Author

Thank you and great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants