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

Why doesn't the code generated by UWP's App.xaml contain the LoadComponent method #1931

Open
Gaoyifei1011 opened this issue Feb 23, 2025 · 1 comment

Comments

@Gaoyifei1011
Copy link
Contributor

Why doesn't the code generated by UWP's App.xaml contain the LoadComponent method

------------------------------------

为什么 UWPApp.xaml 生成的代码没有包含 LoadComponent 方法


Image

如图片所示,WinUI 3(左侧)的 App.xaml 生成的代码 WinUIApp.g.i.cs 包含 LoadComponent 方法,可以加载对应的 App.xaml 文件,但在 UWP(右侧) 中却没有包含相应的实现,如果在 Xaml islands 中,将 App.xaml 修改成其他名称(比如 TestApp.xaml),应用程序在启动时会因为找不到资源而失败

As shown in the picture, the code generated by App.xaml of WinUI 3 (left) contains the LoadComponent method, which can load the corresponding App.xaml file, but the corresponding implementation is not included in UWP (right). If you change App.xaml to something else in Xaml islands, such as TestApp.xaml, the application will fail at startup because the resource cannot be found

@dongle-the-gadget
Copy link
Contributor

This seems like a XAML issue, not CsWinRT.

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

No branches or pull requests

2 participants