title: Lying exceptions in Blend for Visual Studio
body: <p>Every once in a while I get compiler exceptions in Blend for Visual Studio. Everything is compiling and working wonderfully, then suddenly BAM! I get compiler errors telling me that objects don't exist in a specific namespace WHEN THEY DO. I have to play with cleaning and rebuilding and closing and reopening Blend for a bout an hour before they go away. My libraries are all up to date and everything is otherwise fine. Does no one else have this happen to them? Please, I want it to stop it is an enormous time killer.</p>
  
  <p>I get the compiler errors in Visual Studio as well. </p>
  
  <p>Thanks.</p>
  
  <p><strong>Updates</strong></p>
  
  <p>For instance,</p>
  
  <blockquote>
    <p>Error 5   The property 'DesignWidth' does not exist in XML namespace '<a href="http://schemas.microsoft.com/expression/blend/2008" rel="noreferrer">http://schemas.microsoft.com/expression/blend/2008</a>'. Line 15 Position 5.    C:\MyPath\MyControl.xaml    15  5   EasyBuilder</p>
  </blockquote>
  
  <p>As far as I know, <code>DesignWidth</code> is does very much exist in that namespace.</p>
  
  <p><strong>The XAML (Not that it will help you any)</strong></p>
  
  <pre><code>&lt;UserControl x:Name="UserControl" x:Class="EasyBuilder.MainControl"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:ignore="http://www.ignore.com"
               xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
               xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
               xmlns:surface="http://schemas.microsoft.com/surface/2008" 
               xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
               xmlns:gif="http://wpfanimatedgif.codeplex.com"
               xmlns:local="clr-namespace:EasyBuilder"
               xmlns:res="clr-namespace:EasyBuilder.Infrastructure.Resources"
               xmlns:system="clr-namespace:System;assembly=mscorlib"
               d:DesignWidth="640" d:DesignHeight="480"&gt;
      &lt;UserControl.Resources&gt;
          &lt;res:MainViewStrings x:Key="LocalStrings" /&gt;
      &lt;/UserControl.Resources&gt;
  
      &lt;UserControl.DataContext&gt;
          &lt;Binding Path="Main" Source="{StaticResource Locator}"/&gt;
      &lt;/UserControl.DataContext&gt;
  
      &lt;Grid x:Name="LayoutRoot" Background="{DynamicResource PageBackgroundBrush}"&gt;
          &lt;VisualStateManager.VisualStateGroups&gt;
              &lt;VisualStateGroup x:Name="OpenSelectionStateGroup"&gt;
                  &lt;VisualStateGroup.Transitions&gt;
                      &lt;VisualTransition GeneratedDuration="0:0:0.15"&gt;
                          &lt;VisualTransition.GeneratedEasingFunction&gt;
                              &lt;CircleEase EasingMode="EaseOut"/&gt;
                          &lt;/VisualTransition.GeneratedEasingFunction&gt;
                      &lt;/VisualTransition&gt;
                  &lt;/VisualStateGroup.Transitions&gt;
                  &lt;VisualState x:Name="SelectionClosedState"/&gt;
                  &lt;VisualState x:Name="SelectionOpenedState"&gt;
                      &lt;Storyboard&gt;
                          &lt;BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)" Storyboard.TargetName="OpenFileSelection"&gt;
                              &lt;DiscreteBooleanKeyFrame KeyTime="0" Value="False"/&gt;
                          &lt;/BooleanAnimationUsingKeyFrames&gt;
                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CloseFileSelection"&gt;
                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="1"/&gt;
                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)" Storyboard.TargetName="CloseFileSelection"&gt;
                              &lt;DiscreteBooleanKeyFrame KeyTime="0" Value="True"/&gt;
                          &lt;/BooleanAnimationUsingKeyFrames&gt;
                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OpenFileSelection"&gt;
                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="0"/&gt;
                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="FileSelectionShadow"&gt;
                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="12.5"/&gt;
                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="FileSelection"&gt;
                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="450"/&gt;
                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FileSelectionControl"&gt;
                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="1"/&gt;
                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                      &lt;/Storyboard&gt;
                  &lt;/VisualState&gt;
              &lt;/VisualStateGroup&gt;
          &lt;/VisualStateManager.VisualStateGroups&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition/&gt;
              &lt;ColumnDefinition Width="Auto"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Frame x:Name="ContentFrame" Margin="0,0,100,0" Grid.ColumnSpan="2" NavigationUIVisibility="Hidden"/&gt;
          &lt;Grid x:Name="FileSelection" Grid.Column="1" Width="100" Background="{DynamicResource AsideSectionBackgroundBrush}"&gt;
              &lt;Border x:Name="FileSelectionShadow" Width="12.5" HorizontalAlignment="Left"&gt;
                  &lt;Border.Background&gt;
                      &lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&gt;
                          &lt;GradientStop Color="#3F000000" Offset="0"/&gt;
                          &lt;GradientStop Color="#00000000" Offset="1"/&gt;
                      &lt;/LinearGradientBrush&gt;
                  &lt;/Border.Background&gt;
              &lt;/Border&gt;
              &lt;Button x:Name="OpenFileSelection" Template="{DynamicResource InvisibleButtonTemplate}" HorizontalContentAlignment="Right" Panel.ZIndex="1" Margin="0"&gt;
                  &lt;i:Interaction.Triggers&gt;
                      &lt;i:EventTrigger EventName="Click"&gt;
                          &lt;ei:GoToStateAction StateName="SelectionOpenedState"/&gt;
                      &lt;/i:EventTrigger&gt;
                  &lt;/i:Interaction.Triggers&gt;
                  &lt;TextBlock TextWrapping="Wrap" Text="{Binding OpenActionText, Mode=OneWay, Source={StaticResource LocalStrings}}"  Margin="0,0,23,0" Style="{DynamicResource AsideSectionLabel}"/&gt;
              &lt;/Button&gt;
              &lt;local:FileSelectionView x:Name="FileSelectionControl" d:LayoutOverrides="Width" Opacity="0" DataContext="{Binding Files, Mode=OneWay}"/&gt;
          &lt;/Grid&gt;
          &lt;Button x:Name="CloseFileSelection" Template="{DynamicResource InvisibleButtonTemplate}" IsHitTestVisible="False" Opacity="0" Margin="0" d:IsHidden="True"&gt;
              &lt;i:Interaction.Triggers&gt;
                  &lt;i:EventTrigger EventName="MouseEnter"&gt;
                      &lt;ei:GoToStateAction StateName="SelectionClosedState"/&gt;
                  &lt;/i:EventTrigger&gt;
              &lt;/i:Interaction.Triggers&gt;
          &lt;/Button&gt;
          &lt;Border x:Name="UserMessage" Background="#BF000000" Visibility="{Binding UserMessenger.IsShowingMessage, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" Grid.ColumnSpan="2"&gt;
              &lt;Border VerticalAlignment="Center" Style="{DynamicResource UserMessageStyle}" Background="#FFE2E2E2" BorderBrush="{x:Null}" BorderThickness="0" MaxWidth="800" HorizontalAlignment="Center" MinWidth="400"&gt;
                  &lt;Border.Effect&gt;
                      &lt;DropShadowEffect Opacity="0.5" ShadowDepth="10"/&gt;
                  &lt;/Border.Effect&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition/&gt;
                          &lt;RowDefinition Height="Auto"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;TextBlock TextWrapping="Wrap" Text="{Binding UserMessenger.MessageText, Mode=OneWay}" Margin="0,0,0,10" HorizontalAlignment="Center" MinHeight="58" Style="{DynamicResource TextBlockBase}"/&gt;
                      &lt;StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right"&gt;
                          &lt;Border x:Name="OKAction" Style="{DynamicResource ButtonBorderStyle}" Margin="15,0,0,0" Height="50" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="{Binding UserMessenger.ShowOkButton, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}"&gt;
                              &lt;Border.Effect&gt;
                                  &lt;DropShadowEffect Opacity="0.33"/&gt;
                              &lt;/Border.Effect&gt;
                              &lt;Button Template="{DynamicResource FlatButtonTemplate}" Command="{Binding UserMessenger.CloseCommand, Mode=OneWay}" Margin="0"&gt;
                                  &lt;Button.CommandParameter&gt;
                                      &lt;system:String&gt;OK&lt;/system:String&gt;
                                  &lt;/Button.CommandParameter&gt;
                                  &lt;Image Height="44" Source="Skins/Images/OK.png"/&gt;
                              &lt;/Button&gt;
                          &lt;/Border&gt;
                          &lt;Border x:Name="CancelAction" Style="{DynamicResource ButtonBorderStyle}" Margin="15,0,0,0" Height="50" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="{Binding UserMessenger.ShowCancelButton, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}"&gt;
                              &lt;Border.Effect&gt;
                                  &lt;DropShadowEffect Opacity="0.33"/&gt;
                              &lt;/Border.Effect&gt;
                              &lt;Button Template="{DynamicResource FlatButtonTemplate}" Command="{Binding UserMessenger.CloseCommand, Mode=OneWay}" Margin="0"&gt;
                                  &lt;Button.CommandParameter&gt;Cancel&lt;/Button.CommandParameter&gt;
                                  &lt;Image Height="44" Source="Skins/Images/Cancel.png"/&gt;
                              &lt;/Button&gt;
                          &lt;/Border&gt;
                      &lt;/StackPanel&gt;
                  &lt;/Grid&gt;
              &lt;/Border&gt;
          &lt;/Border&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>