首页 > 解决方案 > WinUI 3 和 Windows 社区工具包 - InitializeComponent 错误

问题描述

尝试使用 Windows App SDK 1.0.0 实验性 1 将 Windows 控件工具包与 WinUI 3 一起使用。

我收到这两个错误:

Error   CS1061  'App' does not contain a definition for 'InitializeComponent'

Error   NETSDK1022  Duplicate 'Page' items were included. The .NET SDK includes 'Page' items from your project directory by default.

我在桌面实验项目类型中使用 WinUI,即: 在此处输入图像描述

看起来 Windows App SDK 和 WCT Nuget 包之间存在一些交叉,但我可以采取哪些步骤来解决这个问题并使用 WCT?

标签: windows-community-toolkitwinui-3

解决方案


发现这个github 问题后,WCT 似乎与 WinUI 3 不兼容。


推荐阅读