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

TypeLoadException for method CreateEmbeddableTopLevel in Win32Platform after updating Avalonia to 11.2.0 #17471

Closed
sinatrocious opened this issue Nov 11, 2024 · 3 comments
Labels

Comments

@sinatrocious
Copy link

sinatrocious commented Nov 11, 2024

Describe the bug

I wanted to test #14517 with latest Avalonia version, so I created new Avalonia app with wizard (it adds version 11.1.0), changed startup project to .Desktop one (known issue, that it needs to be changed) and run it without changing anything else - it runs OK.

Then I updated nugets to 11.2.0 and start getting exception upon running:

image

System.TypeLoadException
  HResult=0x80131522
  Message=Method 'CreateEmbeddableTopLevel' in type 'Avalonia.Win32.Win32Platform' from assembly 'Avalonia.Win32, Version=11.1.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b' does not have an implementation.
  Source=Avalonia.Win32
  StackTrace:
   at Avalonia.Win32ApplicationExtensions.<>c.<UseWin32>b__0_0()
   at Avalonia.AppBuilder.SetupUnsafe() in Avalonia\AppBuilder.cs:line 226
   at Avalonia.AppBuilder.Setup() in Avalonia\AppBuilder.cs:line 218
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime) in Avalonia\AppBuilder.cs:line 131
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder) in Avalonia\ClassicDesktopStyleApplicationLifetimeExtensions.cs:line 28
   at AvaloniaApplication23.Desktop.Program.Main(String[] args) in C:\Users\User\source\repos\AvaloniaApplication23\AvaloniaApplication23.Desktop\Program.cs:line 14

To Reproduce

  1. Create new Avalonia C# app (default settings)
  2. Change startup project to .Desktop
  3. Run (should work)
  4. Update Avalonia nugets to 11.2.0 (from 11.1.0 as for me)
  5. Run -> Exception

Expected behavior

Should run without issues or at least tell what needs to be changed if it's breaking change.

Avalonia version

11.2.0

OS

Windows

Additional context

No response

@sinatrocious
Copy link
Author

It's my mistake. I forgot to update nuget for second solution, namely nuget Avalonia.Desktop. It was still of older version 11.1.0.

@sarfaraz78615
Copy link

Again it is getting error when i upgraded my project from 11.1.0 to 11.2.3

@kekekeks
Copy link
Member

You have a version mismatch for different Avalonia packages. Use a single version number for all of them

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

No branches or pull requests

3 participants