title: WPF: The name does not exist in the namespace
body: <p>I am building a C#/WPF application using VS2013, and I have the following class definition (in the same assembly of the running application):</p>
  
  <pre><code>namespace MyNamespace
  {
      public class MyKey
      {
          public MyKey() { }
          public string name = "";
      }
  }
  </code></pre>
  
  <p>In MainWindow.xaml I have:</p>
  
  <pre><code>&lt;Window x:Class="MyNamespace.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:MyNamespace"
          Title="MainWindow" Height="350" Width="525" WindowState="Maximized" WindowStyle="None"&gt;
      &lt;Window.Resources&gt;
          &lt;local:MyKey x:Key="key" /&gt;
      &lt;/Window.Resources&gt;
  ...
  </code></pre>
  
  <p>VS keeps reporting that </p>
  
  <blockquote>
    <p>The name "MyKey" does not exist in namespace
    "clr-namespace:MyNamespace"</p>
  </blockquote>
  
  <p>Any ideas?</p>
  
  <p>P.S. I tried the following solutions (from already posted questions in stackoverflow) but none of them worked:</p>
  
  <ol>
  <li>Moving the class to a different namespace, then using the new namespace in xaml reference</li>
  <li>Restarting VS and cleaning/rebuilding the solution</li>
  <li>cleaning the solution then renaming its folder then building the solution again</li>
  <li>changing the reference to:</li>
  </ol>
  
  <blockquote>
    <p>xmlns:local="clr-namespace:MyNamespace;assembly="</p>
  </blockquote>
  
  <p>Edit: Additional info: The target architecture: X64, target framework: .Net 4.5</p>