Title: microsoft.ui.xaml not found
Tags: c#;wpf
Question: I installed the microsoft.ui.xaml NuGeT to my WPF Project and added the following to the app.xaml Merged Dictionarys (as the documentation said ):
<Application&gt;
<Application.Resources&gt;
<ResourceDictionary&gt;
<ResourceDictionary.MergedDictionaries&gt;
<XamlControlsResources xmlns=&quot;using:Microsoft.UI.Xaml.Controls&quot;/&gt;
<!-- MahApps --&gt;
<ResourceDictionary Source=&quot;pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml&quot; /&gt;
<ResourceDictionary Source=&quot;pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml&quot; /&gt;
<ResourceDictionary Source=&quot;pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml&quot; /&gt;
<ResourceDictionary Source=&quot;pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml&quot; /&gt;
...
</ResourceDictionary.MergedDictionaries&gt;
</ResourceDictionary&gt;
</Application.Resources&gt;
</Application&gt;
But VS displays the following errors:
&quot;CS0234 7   The type or namespace name 'UI' does not exist in the namespace 'Microsoft'
&quot;
&quot;
XDG0008 16  The name &quot;XamlControlsResources&quot; does not exist in the namespace &quot;using:Microsoft.UI.Xaml.Controls&quot;.&quot;
Does someone know how I can make it work / find the assembly error?

Here is the accepted answer: You are using WinUI 2.x which is not compatible with WPF, it can only be used with UWP.
The WinUI 2.x Library is closely coupled to the Windows 10 SDK and provides official native Windows UI controls and other UI elements for UWP apps.
Support for WPF is introduced in WinUI 3, which is currently only available as preview.
Comment for this answer: ah, i did not see that. Thank you!


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:08/24/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><wpf>', 'Title': 'microsoft.ui.xaml not found', 'ViewCount': 1293, 'id': 63556346, 'user_AboutMe': None, 'user_AccountId': 17098694.0, 'user_DisplayName': 'Arne_22', 'user_Reputation': 57.0, 'user_Views': 13.0, 'user_id': 12373140.0}}