title: Assembly reference not found in XAML, but code compiles when referenced in xaml.cs class
body: <p>I've got a strange problem adding a dll reference. I've got a WPF application and am trying to use the WPF MDI library: <a href="http://wpfmdi.codeplex.com/" rel="noreferrer">http://wpfmdi.codeplex.com/</a></p>
  
  <p>As stated in the instructions (which are very vague), I right-clicked on references in VS2012, clicked on <code>Add reference..</code>, clicked on <code>Browse..</code> and added my dll which I downloaded.</p>
  
  <p>Next, I added the following line in the XAML of my window: <code>xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"</code> as stated in the instructions.</p>
  
  <p>However, when trying to add an <code>&lt;mdi:MdiContainer&gt;</code> in the XAML, the following error messages are displayed:</p>
  
  <p><code>The type 'mdi:MdiContainer' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.</code>  </p>
  
  <p><code>The name "MdiContainer" does not exist in the namespace "clr-namespace:WPF.MDI;assembly=WPF.MDI".</code></p>
  
  <p>This is my XAML:</p>
  
  <pre><code>&lt;Window x:Class="QueryBuilder.Table"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
          Height="300" Width="300" WindowStyle="ToolWindow" ResizeMode="NoResize" ShowInTaskbar="False"&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>This problem has been frustrating me all day. I've tried almost everything imaginable. One thing worth noticing is that I've downlaoded the sample application from the library's site, and I can run it with no problems.  Besides this, I have added this to the xaml.cs class of my project: <code>WPF.MDI.MdiContainer d = new WPF.MDI.MdiContainer();</code> and it compiles with no problems at all.</p>
  
  <p>Please also note that my initial problem was asked <a href="https://stackoverflow.com/questions/12884408/adding-dll-reference/12884756#comment17447229_12884756">here</a>, and none of the suggestions worked. The problem has now changed however, due to the above paragraph which seems to indicate that the code is compiled successfully in the code behind, but not in the XAML file.</p>
  
  <p><strong>EDIT:</strong> I would also like to add that I am able to browse through the code of the assembly reference as shown below.</p>
  
  <p><img src="https://i.stack.imgur.com/M0eOr.png" alt="enter image description here"></p>