microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.78k stars 319 forks source link

Unable to run published msixbundle due to application crashes at start #4690

Open k1mmm opened 2 weeks ago

k1mmm commented 2 weeks ago

Describe the bug

When trying to run a published application it crashes at startup

Application: Capster.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'WinRT.TypeNameSupport' threw an exception.
 ---> System.TypeLoadException: Could not load type 'System.Collections.Generic.List`1' from assembly 'System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at WinRT.TypeNameSupport..cctor()
   --- End of inner exception stack trace ---
   at WinRT.ProjectionInitializer.InitalizeProjection()
   --- End of inner exception stack trace ---
   at Capster.Program.Main(String[] args)

Steps to reproduce the bug

Create a winui3 application in visual studio Publish the application Install & run

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.5.6: 1.5.240802000

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

No response

k1mmm commented 1 week ago

I've updated to Windows App SKD 1.6, and now the error are different:

Application: Capster.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.MissingMethodException: Method not found: 'Void System.Runtime.CompilerServices.IAsyncStateMachine.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)'.
   at Capster.Program.Main(String[] args)
   at Capster.Program.<Main>(String[] args)