AvaloniaUI/AvaloniaMauiHybrid

Error when using MAUI 8.0.6

curia-damiano opened this issue · 4 comments

I have already described my issues with Avalonia.Maui when using .NET 8 and Avalonia 11.0.6 in this issue: #14 (comment)

Related to this issue, I have a second problem (that I track in a different issue to facilitate tracking):

  • when updating MAUI to 8.0.6 (currently the latest public version), I need to explicitly add the package Microsoft.Maui.Controls.Compatibility to the target projects (Android, iOS)
  • otherwise the application compiles, but when running, I get a FileNotFoundException of the file Microsoft.Maui.Controls.Compatibility.dll.

It would be good if Avalonia.Maui could use the version of the NuGet package of the same version of the MAUI I am using.

It would be good if Avalonia.Maui could use the version of the NuGet package of the same version of the MAUI I am using.

Avalonia.Maui doesn't reference any specific version of Maui. It's just a <UseMaui>true</UseMaui> + specific TFM version.

I don't know where Microsoft.Maui.Controls.Compatibility reference could came from. We do not reference it. At least not explicitly.

Hi @maxkatz6 , even with 11.0.9 I have the same issue (i.e. I need to reference the Maui.Compatibility NuGet explicitly).
Would it be possible to share a repro project - PRIVATELY? (it is for one of my customers)

We can do it privately only through Avalonia support contracts.

Other than that, I still don’t understand why you need Microsoft.Maui.Controls.Compatibility to be added. I.e. you haven’t provided even a short stack trace .

If you check this repository projects, they use MAUI 8.0.3 for library itself now, and 8.0.6 for samples. My last comment is not up to date anymore, we do reference specific version now.

Hi @maxkatz6 ,
Here is the stack trace I get from Visual Studio when the exception happens:

System.IO.FileNotFoundException
Message=Could not load file or assembly 'Microsoft.Maui.Controls.Compatibility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

stacktrace

Would it be possible to share privately with you my solution, where you could see the exception happening_