What is causing "The type or namespace name 'UI' does not exist in the namespace" error? <p>I am working on a UWP application and I am trying to do something with the values of a SelectedItem in a GridView. So as I usually do with WPF I went into the XAML and Typed my event name in the XAML and let VS create the event in code for me. </p> <pre><code>&lt;GridView x:Name="DataGrid1" ItemClick="dg_ItemClick"&gt; &lt;!-- Just --&gt; &lt;!-- Some --&gt; &lt;!-- Normal --&gt; &lt;!-- XAML --&gt; &lt;/GridView&gt; </code></pre> <p>and the VS created event looks like this</p> <pre><code> private void dg_ItemClick(object sender, Windows.UI.Xaml.Controls.ItemClickEventArgs e) { Biz.Customer cust = e.ClickedItem as Biz.Customer; var messageDialog2 = new MessageDialog(cust.Code, cust.Company); messageDialog2.ShowAsync(); } </code></pre> <p>Right away I get a red squiggly line under the UI in the Windows.UI.Xaml.Controls part. There is a using at the top of the page to include that and VS wouldn't let add any other UWP references. </p> <p>I can get the error to go away as I have in other parts of the application by changing the ItemClickEventArgs to RoutedEvenArgs but in this case I really need the ClickedItem as an argument to be passed to the code behind. </p> <p>I have just talked to someone else getting started with UWP and they said they are having the same issue on other cLick events. So are we both doing something wrong or is there something missing from our application that is needed for the UI to be recognized?</p> <p>The full error I am getting is this: Error CS0234 The type or namespace name 'UI' does not exist in the namespace 'app name' (are you missing an assembly reference?)</p>