WinUI 3.0 for desktop apps default project gives runtime error

0

Using Windows UI Library 3 Preview 2 (July 2020) that was released just yesterday. On latest version of VS2019 - Preview, followed this official tutorial Get started with WinUI 3 for desktop apps to create a desktop project. Project successfully compiles but gives the following error when running in debug mode. I'm using 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

Screenshot of the error:

enter image description here

c#
winui
winui-3
asked on Stack Overflow Jul 17, 2020 by nam

1 Answer

1

I ran into this issue as well, updating .NET 5 SDK to preview 6 solved it for me. Link to the installer: https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-5.0.100-preview.6-windows-x64-installer

answered on Stack Overflow Jul 17, 2020 by gergelygembela

User contributions licensed under CC BY-SA 3.0