title: XAML MarkupCompilePass2 fails on a WPF project
body: <p>When I try to build my WPF project I get the folowing error:<br><code>Samotorcan.Client.WPF.Windows8\Views\MainWindow.xaml(1,17): error MC3074: The tag 'Window' does not exist in XML namespace 'clr-namespace:Samotorcan.Client.WPF.Windows8.Controls'. Line 1 Position 17.</code><br><br>The problem only occurs when I try to use linq. If I have a line like this <code>new List&lt;object&gt;().ToArray&lt;object&gt;();</code> somewhere in the <code>MainWindow.xaml.cs</code>file I get the above error and if I change it to <code>new List&lt;object&gt;().ToArray();</code> the error disappears and the project builds successfully.<br><br>I also checked the build log and it contains the same error at task MarkupCompilePass2.<br><br>I am using .NET Framework 4.5 and Visual Studio 2012.<br><br>EDIT<br>After playing with it a bit I managed to find out that it's not specificly related to linq an random changes like removing an unused file from a project or just removing parts of code like a simple string creating <code>string s = new String();</code> fixes the error.<br><br>At one point a simple change in a constructor from this</p>
  
  <pre><code>public LoggedEventArgs(string message)
  {
      Message = message;
  }
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>public LoggedEventArgs(string message)
  {
      // Message = message;
  }
  </code></pre>
  
  <p>fixed the error.</p>