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

Crash on start (EntryPointNotFoundException) #490

Closed
2 of 24 tasks
LucaCris opened this issue Aug 26, 2024 · 24 comments · Fixed by #500
Closed
2 of 24 tasks

Crash on start (EntryPointNotFoundException) #490

LucaCris opened this issue Aug 26, 2024 · 24 comments · Fixed by #500
Assignees
Labels
bug Something isn't working CI/pipeline 🔬 low difficulty A small or trivial change that isn't difficult to complete. nuget 📦 regression What was working is now broke

Comments

@LucaCris
Copy link

Describe the bug

WinUI 3 App, latest SDK version 1.5.6.

If I perform these updates (also a single one):

Screenshot 2024-08-26 134333

I'll get this, just after F5:

Screenshot 2024-08-26 134245

Rollback updates and all restart to work perfectly.

Steps to reproduce

As descripted.

Expected behavior

Run as before.

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

net8.0-windows10.0.22621.0

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.11.1

Device form factor

Desktop

Additional context

No response

Help us help you

No, I'm unable to contribute a solution.

@Arlodotexe
Copy link
Member

Arlodotexe commented Aug 26, 2024

@LucaCris Could you provide a minimal repro for this, or a list of the nuget packages you have installed?

This is an error message I've seen when you install Microsoft.UI.Xaml alongside Microsoft.WindowsAppSDK, but I can't be sure it's the same repro without more details.

@LucaCris
Copy link
Author

Add these to the screenshot above:

CommunityToolkit.Mvvm 8.2.2
CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2
CommunityToolkit.WinUI.UI.Controls.Markdown 7.1.2
Microsoft.Windows.SDK.BuildTools 10.0.26100.1
Microsoft.WindowsAppSDK 1.5.240802000

@CommunityToolkit CommunityToolkit deleted a comment Aug 27, 2024
@LucaCris
Copy link
Author

How to simply replicate:

  • create new packaged App using wizard
  • upgrade SDKs to latest
  • App will start normally
  • Add one CommunityToolkit 8.1, to have something like:

Screenshot 2024-08-29 163814

The App will crash on start.

@Arlodotexe Arlodotexe moved this to 👀 In review in Toolkit 8.x Aug 29, 2024
@Arlodotexe
Copy link
Member

Arlodotexe commented Aug 29, 2024

@LucaCris I was able to reproduce the issue with the "Blank App, Packaged (WinUI 3 in Desktop)" project template, but only unpackaged, and regardless of whether the toolkit is installed.

Running packaged seems to work fine, unpackaged gives the error message you were seeing. Can you provide more information about your packaging setup?

@LucaCris
Copy link
Author

Watch the screenshot: App8 (Package) + App8... all done by VS Wizard:

Screenshot 2024-08-30 092607

@wbokkers
Copy link

wbokkers commented Sep 2, 2024

I see the same issue on my packaged project (with a separate package project).

@giraudremy
Copy link

Hi,

I have same issue, here a sample app.
App7.zip

I have change to target 22621 targetframework but not working for me.
net8.0-windows10.0.22621.0

Is there something missing in the projet ?

@lhak
Copy link
Contributor

lhak commented Sep 3, 2024

@giraudremy I looked at your sample project and found the issue, but I do not know how to fix it. The issue is that in the packaging project, the community toolkit nuget package shows a dependency on the winui2 Microsoft.ui.xaml package. This is not the case for the application project itself.

@LucaCris
Copy link
Author

LucaCris commented Sep 3, 2024

@giraudremy I looked at your sample project and found the issue, but I do not know how to fix it. The issue is that in the packaging project, the community toolkit nuget package shows a dependency on the winui2 Microsoft.ui.xaml package. This is not the case for the application project itself.

The idea is to work like 8.0 does, on start... 😉

@giraudremy
Copy link

giraudremy commented Sep 3, 2024

Hi,

I have added a PackageDependency to WindowsAppRuntime in Package.appxmanifest and now application start :

<Dependencies>
     <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.22621.0" MaxVersionTested="10.0.22621.0" />
     <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.22621.0" MaxVersionTested="10.0.22621.0" />
     <PackageDependency Name="Microsoft.WindowsAppRuntime.1.5" MinVersion="1.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
  </Dependencies>

@lhak
Copy link
Contributor

lhak commented Sep 4, 2024

One possibility to workaround this issue is to add <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> to the packaging project file. I guess the issue is that the packaging project sets this value to UAP by default and thus the UWP dependencies of the toolkit nuget package get added.

@MagnusJohansson
Copy link

MagnusJohansson commented Sep 4, 2024

I have the same issue.

  • Create a simple blank WinUI3 from the VS templates (packaged or un-packaged, doesn't matter).
  • Add the latest CommunityToolkit.WinUI.Animations v.8.1.240821:
    <PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.1.240821" />
    and the application crashes with:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in TestApp.dll
Unable to find an entry point named 'XamlCheckProcessRequirements' in DLL 'Microsoft.ui.xaml.dll'.

image

Rolling back to the previous version of CommunityToolkit.WinUI.Animations
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.0.240109" />
fixes the problem.

The above suggestion regarding <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> doesn't work.

EDIT: It seems that any CommunityToolkit.WinUI.* of the latest version v.8.1.240821 causes the issue, not only the .Animations package

@lhak
Copy link
Contributor

lhak commented Sep 4, 2024

@MagnusJohansson Do you have a repro project? I used the following steps and cannot reproduce this issue:

-Create a new packaged winui app in Visual Studio
-Add the animation nuget package
-Change the target framework to <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>

Adding the <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> property should only be necessary if a separate packaging project is used.

@MagnusJohansson
Copy link

MagnusJohansson commented Sep 4, 2024

@lhak Sorry, I misspoke, the problem only occurs when using a separate packaging project.

Here's a reproducible solution:

The previous Nuget package (v8.0.240109 ) works fine:
https://github.com/MagnusJohansson/WinUI3PackagingProject/tree/feature/community-toolkit-v8.0.240109

The latest Nuget package (v8.1.240821) crashes:
https://github.com/MagnusJohansson/WinUI3PackagingProject/tree/feature/community-toolkit-v8.1.240821

(EDIT: updated with the recommendations; still crashes)

@LucaCris
Copy link
Author

LucaCris commented Sep 4, 2024

@MagnusJohansson Do you have a repro project? I used the following steps and cannot reproduce this issue:

-Create a new packaged winui app in Visual Studio -Add the animation nuget package -Change the target framework to <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>

Adding the <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> property should only be necessary if a separate packaging project is used.

Wizard packaged project is enough to replicate, trust me...

@lhak
Copy link
Contributor

lhak commented Sep 4, 2024

@MagnusJohansson I can reproduce the crash, but can fix it by adding <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> below <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> in the packaging project file. I also changed TargetPlatformVersion to 10.0.22621.0 because I do not have the corresponding SDK installed, but I hope this does not make a difference.

@MagnusJohansson
Copy link

@lhak That seems to do the trick.
Thank you.

@LucaCris
Copy link
Author

LucaCris commented Sep 4, 2024

Trick not working nor on my main App neither on my wizard simple test...

@Arlodotexe
Copy link
Member

Arlodotexe commented Sep 5, 2024

One possibility to workaround this issue is to add <TargetPlatformIdentifier>windows</TargetPlatformIdentifier> to the packaging project file. I guess the issue is that the packaging project sets this value to UAP by default and thus the UWP dependencies of the toolkit nuget package get added.

Thanks for your help @lhak! This workaround fixes the issue in my local repro, and I can confirm that building packages without the uap TFM included on the WinUI 3 head fixes the issue without adding TargetPlatformIdentifier. This was a packaging mistake and is something we can push a patch to fix so the workaround won't be required.

@wbokkers
Copy link

wbokkers commented Sep 6, 2024

@Arlodotexe @lhak The workaround using the TargetPlatformIdentifier might work, but unfortunately this breaks the packaging tools (when adding it to the packaging project).
As soon a I choose 'Create App Packages' I get an error that the manifest is not valid.
My manifest also uses uap namespaces for protocol definitions, execution aliases, and the like. I'm not sure if this is related.

I tried to add TargetPlatformIdentifier to the main project, but then the app still crashes with the same error.

@MagnusJohansson
Copy link

Same packaging problem here.

Reproducible project:
https://github.com/MagnusJohansson/WinUI3PackagingProject/tree/feature/community-toolkit-v8.1.240821

Just select Publish->Create app Package and you get:
image

@LucaCris
Copy link
Author

LucaCris commented Sep 6, 2024

It is now time to temporarily remove the update from nuget... 😑

@michael-hawker
Copy link
Member

Ah, this is a regression of #220; now that I see the PR, I understand! 😅

@michael-hawker michael-hawker added the bug Something isn't working label Sep 6, 2024
@michael-hawker michael-hawker added low difficulty A small or trivial change that isn't difficult to complete. regression What was working is now broke CI/pipeline 🔬 nuget 📦 labels Sep 6, 2024
@michael-hawker michael-hawker pinned this issue Sep 6, 2024
@michael-hawker
Copy link
Member

Shipped a hotfix in v8.1.240916, just pushed to NuGet. Will be merged to main as well shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI/pipeline 🔬 low difficulty A small or trivial change that isn't difficult to complete. nuget 📦 regression What was working is now broke
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

15 participants
@MagnusJohansson @wbokkers @Arlodotexe @michael-hawker @lhak @LucaCris @giraudremy and others