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

Runtime crash on upgrading to .NET 8 with SDK 1.5 #4240

Open rocksdanister opened 6 months ago

rocksdanister commented 6 months ago

Describe the bug

Related: https://github.com/microsoft/WindowsAppSDK/issues/3842

From what I understand <UseRidGraph>true</UseRidGraph> is no longer required with the latest SDK but my application is still crashing without it when switching to .NET 8.

Project file: https://github.com/rocksdanister/lively/blob/core-separation/src/Lively/Lively.UI.WinUI/Lively.UI.WinUI.csproj

Steps to reproduce the bug

  1. Comment out <UseRidGraph>true</UseRidGraph> line.
  2. Run the Lively core project in the background.
  3. Run the WinUI UI project.

Expected behavior

Application should work without the project file change.

Screenshots

image

NuGet package version

Windows App SDK 1.5.0: 1.5.240227000

Packaging type

Unpackaged

Windows version

No response

IDE

Visual Studio 2022

Additional context

Windows version 23H2 Build 22631.3155

ghost1372 commented 6 months ago

first of all, please change your TargetFramework from <TargetFramework>net8.0-windows10.0.18362.0</TargetFramework> to <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>

i fixed my app crash when i updated to newer targetframework, so try it.

it seems that your are using old versions of libraries like CommunityToolkit which is designed for net 7.0:

<PackageReference Include="CommunityToolkit.WinUI.UI.Animations" Version="7.1.2" /> there is a new versions for net 8.0, so please update all libraries. <PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.0.240109" />

rocksdanister commented 5 months ago

Unfortunately the issue still remains even after upgrading target framework and CommunityToolkit.