Name "X" does not exists in the namespace "clr-namespace:Y;assembly=Z"
<p>I was recently designing a custom Window for WPF, my very first. But I had a problem with TargetType and clr-namespace.</p>

<p>The code is:</p>

<pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:sf="clr-namespace:Suite.Forms;assembly=bhsuite"&gt;
&lt;Style TargetType="{x:Type Button}" x:Key="WButtonStyle"&gt;

&lt;/Style&gt;
&lt;Style TargetType="{x:Type Button}" x:Key="ButtonStyle"&gt;

&lt;/Style&gt;
&lt;Style TargetType="{x:Type sf:BHWindow}" x:Key="BHWindowStyle"&gt;

&lt;/Style&gt;
</code></pre>

<p></p>

<p>The problem is obviously at <code>BHWindowStyle</code>, where I try using sf:BHWindow</p>

<p>I tried:</p>

<ul>
<li>Adding <code>;assembly=MyAssembly</code></li>
<li>Including in project references:

<ul>
<li><strong>PresentationCore</strong></li>
<li><strong>PresentationFramework</strong></li>
<li><strong>WindowsBase</strong></li>
<li><strong>System.Xaml</strong></li>
</ul></li>
<li>Restarting as administrator</li>
<li>Cleaning and rebuilding</li>
<li>Change build platform from x86 to x64 to clean and rebuild.</li>
</ul>