AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.84k stars 2.24k forks source link

CreateEmbeddabeWindow does not have an implementation #4938

Closed mrj001 closed 4 years ago

mrj001 commented 4 years ago

Avalonia head is at 849c98aeb on my local repo.

I built Avalonia using: $ ./build.sh --target Package --skip CompileHtmlPreviewer --configuration Debug

I created a project with:

$ dotnet new avalonia.app -n GridTest
$ dotnet add GridT*/*.csproj package Avalonia --version 0.10.0-preview5

I also created:

I had to remove a using statement from Program.cs that referenced Serilog to get this to compile.

When I run this, using:

$ dotnet run -p GridTest

I get this output:

Unhandled exception. System.TypeLoadException: Method 'CreateEmbeddableWindow' in type 'Avalonia.Native.AvaloniaNativePlatform' from assembly 'Avalonia.Native, Version=0.9.12.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. at Avalonia.AvaloniaNativePlatformExtensions.<>c__DisplayClass0_01.<UseAvaloniaNative>b__0() at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) at GridTest.Program.Main(String[] args) in /Users/mj/Documents/develop/avalonia.learn/GridTest/GridTest/Program.cs:line 13

As this error occurred in the native components, I rebuilt that library, and replaced it on my system. This did not fix the problem.

I compiled this from head as of today, but I see the native components is still showing version 0.9.12.0.

mrj001 commented 4 years ago

Closing. I had the following mismatched versions in my .csproj. Fixing this resolved the problem.