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

2
  • 1
    You have most likely found a bug in the preview, which is not uncommon mind you, also considering its only preview 2. If you are concerned about this there are channels where you can register this problem Commented Jul 17, 2020 at 4:36
  • @TheGeneral You are correct, it indeed is a bug (user @user8961312 discovered it and found a solution, as well). Please see my comments below for details. Commented Jul 17, 2020 at 15:42

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Welcome to StackOverflow and doing an excellent job even in your very first response. Keep up the good work. Your suggestion worked (thank you). Step 3 of their official document Install WinUI 3 Preview 2 is still asking for installing .NET 5 SDK to preview 5 that (as you also encountered) does not work for WinUI 3.0 - Preview 2. Can't thank you enough for saving me lots of time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.