Error "The type 'UserControl' does not support direct content" in Visual Studio, yet still compiles
<p>I know a variant of <a href="https://stackoverflow.com/questions/34070333/the-type-usercontrol-does-not-support-direct-content">this question has been asked before</a> but none of the answers there work in my case (and I'm not sure if the other user could actually compile or not)</p>

<p>I create a brand new WPF UserControl file. Visual Studio now displays blue lines around the <code>&lt;Grid&gt;&lt;/Grid&gt;</code> with this error:</p>

<blockquote>
  <p>The type 'UserControl' does not support direct content</p>
</blockquote>

<p>My project already has references to <code>System.Xaml</code> and <code>UIAutomationProvider</code>, as well as the other WPF assemblies <code>PresentationCore</code>, <code>PresentationFramework</code> and <code>WindowsBase</code>.</p>

<p>If I build the solution the error goes away. If I then make a single change to the XAML file (like adding a space somewhere) the error returns.</p>

<p>This is extremely annoying as my entire XAML file ends up being underlined by Visual Studio as having an error and makes it hard to read the contents, when in reality it does not actually have any errors.</p>

<p>What can be done to remedy this situation?</p>