Prism.Avalonia
Prism.Avalonia copied to clipboard
Issue when integrating with Avalonia 11.0 preview 2
System.IO.FileNotFoundException: Could not load file or assembly 'Avalonia.Styling, Version=0.10.16.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'. The system cannot find the file specified.
File name: 'Avalonia.Styling, Version=0.10.16.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'
at Prism.Common.MvvmHelpers.AutowireViewModel(Object viewOrViewModel)
at Prism.PrismApplicationBase.Initialize()
at Snippist.App.Initialize() in C:\Workspace\Galaxism\Snippist\src\App.axaml.cs:line 20
at Avalonia.Controls.AppBuilderBase`1.Setup()
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at Snippist.Program.Main(String[] args) in C:\Workspace\Galaxism\Snippist\src\Program.cs:line 14
Seems like Styling related is integrated in Avalonia.Base assembly. Could you please setup a sample that works for 11.0 preview?
I can run it well when setting all dependencies to 11.0 in this repo's samples. but when referencing them in my own project, it will fail.
Thank you for the heads @rabbitism on what's coming down the pipeline with Avalonia v0.11. Considering Preview 2 was just released 9 days ago, this gives us time to prepare.
Looks like we're going to have to provide a solution to support v0.10.x and 0.11.x if this is a breaking change.
You are always welcome to contribute and submit a PR 👍
I can run it well when setting all dependencies to 11.0 in this repo's samples. but when referencing them in my own project, it will fail.
I had the same issue with Preview2 @ my own Caliburn.Micro project - then I realized it was the Material.Icons dependency causing it. Changing the App.axaml like
<Application.Styles>
<!--<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml"/>-->
<SimpleTheme Mode="Light"/>
</Application.Styles>
resolved it for me.
Update: Although I just noticed your exception refers to a call of Avalonia.Styling, Version=0.10.16.0 whereas I think mine was about Version 0.10.0.0 - then it might as well be something else (including Prism.Avalonia - I haven't looked at it).