title: Xaml parser exception
body: <p>This is something that's driving me crazy.. I have a WPF project which is already in production. Now, I have to make some fix for which I have to set x:Name property to couple of controls. But, when I set x:Name property for <strong>any</strong> control, it's throwing XamlParser exception (inner exception says cannot cast type XXX to type Button where XXX is type of control for which I am setting x:Name property).</p>
  
  <p>It also shows an additional error like,</p>
  
  <p><strong>Additional information: Set connectionId threw an exception.</strong></p>
  
  <p>I have closed and reopened Visual Studio; I have cleaned the solution and rebuilt many times; but no use. </p>
  
  <p>Can anybody let mw know what's going on?</p>
  
  <p>Here is the code - I have just added x:Name = "PnlUpDown" to stack panel.</p>
  
  <pre><code>&lt;StackPanel Name="PnlUpDown" VerticalAlignment="Center" Grid.Column="3"&gt;
              &lt;Button x:Name="BtnMoveUp" Padding="3,5" Margin="5,0,0,3" Tag="MOVEUP" &gt;
                  &lt;Polygon Points="0,15 5,0,10,15" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"/&gt;
              &lt;/Button&gt;
              &lt;Button x:Name="BtnMoveDown" Padding="3,5" Margin="5,3,0,0" Tag="MOVEDOWN" &gt;
                  &lt;Polygon Points="0,0 5,15,10,0" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"/&gt;
              &lt;/Button&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p><strong>Now.. I find that not only x:Name property.. It's not allowing me to set any other property to any control - In general, if I modify my XAML it's throwing error..!!!!!!! For everything it's throwing Set Connection Id error  :(</strong></p>