AvaloniaUtils / DialogHost.Avalonia

AvaloniaUI control that provides a simple way to display a dialog with information or prompt the user when information is needed
MIT License
270 stars 16 forks source link

Crashes using Avalonia 11 nightly #20

Closed alessandrofrancesconi closed 1 year ago

alessandrofrancesconi commented 1 year ago

I'm working with Avalonia 11.0.0-preview5 + DialogHost 0.7.0-preview4. My application style contains these declarations:

<Application.Styles>
    <FluentTheme/>
    <StyleInclude Source="avares://DialogHost.Avalonia/Styles.xaml"/>
    <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>

It works fine, but once I upgrade Avalonia to the nightly build 11.0.999-cibuild0031207-beta, the app crashes at startup with error:

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'DialogHostAvalonia.DialogOverlayPopupHost' threw an exception.
  Source=DialogHost.Avalonia
  StackTrace:
   at CompiledAvaloniaXaml.!AvaloniaResources.Populate:/DialogOverlayPopupHost.axaml(IServiceProvider , Styles )
   at CompiledAvaloniaXaml.!AvaloniaResources.Build:/DialogOverlayPopupHost.axaml(IServiceProvider )
   at CompiledAvaloniaXaml.!AvaloniaResources.Populate:/Styles.xaml(IServiceProvider , Styles )
   at CompiledAvaloniaXaml.!AvaloniaResources.Build:/Styles.xaml(IServiceProvider )
   at GateTrainer.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Users\miste\Projects\Spark\repo\GateTrainer\GateTrainer\GateTrainer\App.axaml:line 11
   at GateTrainer.App.!XamlIlPopulateTrampoline(App )
   at GateTrainer.App.Initialize() in C:\Users\miste\Projects\Spark\repo\GateTrainer\GateTrainer\GateTrainer\App.axaml.cs:line 14
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at GateTrainer.Desktop.Program.Main(String[] args) in C:\Users\miste\Projects\Spark\repo\GateTrainer\GateTrainer\GateTrainer.Desktop\Program.cs:line 22

  This exception was originally thrown at this call stack:

Inner Exception 1:
MissingMethodException: Method not found: 'Avalonia.StyledProperty`1<!!1> Avalonia.AvaloniaProperty.Register(System.String, !!1, Boolean, Avalonia.Data.BindingMode, System.Func`2<!!1,Boolean>, System.Func`3<Avalonia.AvaloniaObject,!!1,!!1>, System.Action`2<Avalonia.AvaloniaObject,Boolean>)'.
alessandrofrancesconi commented 1 year ago

My fault, to solve I just have to recompile DialogHost using the same Avalonia nighlty release, too.