使用昨天刚刚发布的Windows UI Library 3 Preview 2(2020 年 7 月) 。在最新版本上VS2019 - Preview
,按照官方教程开始使用 WinUI 3 桌面应用程序来创建桌面项目。项目成功编译,但在调试模式下运行时出现以下错误。我正在使用Windows10 Pro ver. 1903
:
System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Void System.Runtime.InteropServices.ComWrappers.RegisterForTrackerSupport(System.Runtime.InteropServices.ComWrappers)'.
Source=WinRT.Runtime
StackTrace:
at WinRT.ComWrappersSupport.set_ComWrappers(ComWrappers value)
at WinRT.ComWrappersSupport.InitializeComWrappers(ComWrappers wrappers)
at WinUI_DesptopPreview2.Program.Main(String[] args) in C:\DotNET5VS2019\Desktop_WinUI\WinUI_DesptopPreview2\WinUI_DesptopPreview2\obj\x64\Debug\net5.0\win-x64\App.g.i.cs:line 25
错误截图: