c# – Missing default references in a “WinUI Blank App (Packaged)” project in VS26 (and 22)


The problem

Upon creating a new app with the Basic template, and trying to run the default App, I got hit with 15 missing assembly reference errors. Spent around 1 hour trying to find the solution, even adding custom sources and packages (which probably could’ve been solved by putting more time into, however it is hard to believe that they expect me to install 15 or more packages myself when using a default template). I need to know how to successfully build my newly created app (for those wondering).

I’ve tried installing Visual Studio Community 2022 in case of this being an Insider build related issue, however I ended up with the same experience. When it comes to components, I’ve got the two default ones, as well as Win11 SDK (which I thought it probably wouldn’t work without). Gave adding other two SDK options a try (Win10 and older Win11) as well as “Windows Platform Development tools”, had no luck. Tried checking the “.NET Development” option as well, still nothing.

Errors from the Output tab

The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Input' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Media' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Navigation' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Shapes' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Window' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'LaunchActivatedEventArgs' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Input' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Media' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Navigation' does not exist in the namespace 'Microsoft.UI.Xaml' (are you missing an assembly reference?)
The type or namespace name 'Window' could not be found (are you missing a using directive or an assembly reference?)

Steps to reproduce the bug

  1. Install Visual Studio Installer from MS Store
  2. Find Visual Studio Community 2026 Insiders from the Installer and check the latest Win11 SDK box
  3. Click on the Install button
  4. Open the freshly installed VS26 and press the “Create a new project” button
  5. Choose the “WinUI Blank App (Packaged)” template option
  6. Press the green “Start Without Debugging” button located near the top of the screen (or press Ctrl+F5)
  7. Enjoy the agony you feel when you get hit with 15 – 20 red x’s signifying errors

Screenshots

The screen I am presented with upon trying to build my app

Windows version

Windows 11 (24H2): Build 26100

Note

I’ve already created an issue on the microsoft/microsoft-ui-xaml GitHub page, however, after receiving nothing during the 2 days I decided to wait, I’ve decided to come here (which is why the formatting is very similar to a typical GitHub issue). Here is the issue link:

https://github.com/microsoft/microsoft-ui-xaml/issues/10804

Leave a Reply

Your email address will not be published. Required fields are marked *