title: RibbonControlsLibrary XamlParseException issue VS 2010
body: <p>I have an issue with RibbonControlsLibrary, from the beginning I'm not  able to use those controls in my C# apps. The  problem appears randomly, mostly after reboot. Sometimes reboot helps and it starts to run properly (without  any code changes!). I tested some possibilities and the RibbonWindow control works until I put "Ribbon" control into code! Error is pointed on this control too.
  Strangest is that issue appears when I'm creating new WPF Ribbon Application! In fact code is as simplest as it can be, but still...
  Anyone had this problem? I tried to google it, but couldn't find anything about this.</p>
  
  <p>I have XP so problem with OS blocking file does not count.</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;r:RibbonWindow x:Class="BioSYSTEM.MainWindow"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
   Title="Window1" Height="300" Width="300"&gt;
  &lt;DockPanel&gt;
  &lt;r:Ribbon DockPanel.Dock="Top" Title="title"&gt;
  &lt;/r:Ribbon&gt;
  &lt;/DockPanel&gt;
  
  &lt;/r:RibbonWindow&gt;
  </code></pre>
  
  <p>vS gives me this:</p>
  
  <pre><code>System.Windows.Markup.XamlParseException
  Provide value on 'System.Windows.Markup.StaticExtension' threw an exception.
     at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
     at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
     at System.Windows.Markup.WpfXamlLoader.LoadDeferredContent(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings parentSettings, Uri baseUri)
     at System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
     at System.Windows.ResourceDictionary.RealizeDeferContent(Object key, Object&amp; value, Boolean&amp; canCache)
     at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean&amp; canCache)
     at System.Windows.ResourceDictionary.GetValue(Object key, Boolean&amp; canCache)
     at System.Windows.ResourceDictionary.FetchResource(Object resourceKey, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean&amp; canCache)
     at System.Windows.SystemResources.LookupResourceInDictionary(ResourceDictionary dictionary, Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean&amp; canCache)
     at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean&amp; canCache)
     at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
     at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
     at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
     at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
     at System.Windows.Controls.Menu.OnInitialized(EventArgs e)
     at System.Windows.FrameworkElement.TryFireInitialized()
     at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
     at System.Windows.FrameworkElement.AddLogicalChild(Object child)
     at Microsoft.Windows.Controls.Ribbon.Ribbon.OnApplicationMenuChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in e:\dd\WPFOOB\src\wpfoob\Ribbon\RibbonControlsLibrary\Microsoft\Windows\Controls\Ribbon\Ribbon.cs:line 1356
     at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
     at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
     at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
     at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry&amp; newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
     at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
     at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
     at Microsoft.Windows.Controls.Ribbon.Ribbon.OnLoaded(Object sender, RoutedEventArgs e) in e:\dd\WPFOOB\src\wpfoob\Ribbon\RibbonControlsLibrary\Microsoft\Windows\Controls\Ribbon\Ribbon.cs:line 1501
     at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
     at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
     at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
     at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
     at MS.Internal.LoadedOrUnloadedOperation.DoWork()
     at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
     at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
     at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
     at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
     at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  
  
  System.Reflection.TargetInvocationException
  Exception has been thrown by the target of an invocation.
     at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
     at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
     at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
     at System.Windows.Markup.StaticExtension.GetFieldOrPropertyValue(Type type, String name, Object&amp; value)
     at System.Windows.Markup.StaticExtension.ProvideValue(IServiceProvider serviceProvider)
     at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
  
  
  System.ComponentModel.Win32Exception
  HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
     at Standard.HRESULT.ThrowIfFailed(String message) in e:\dd\WPFOOB\src\wpfoob\WindowChrome\Microsoft.Windows.Shell\Standard\ErrorCodes.cs:line 494
     at Standard.NativeMethods.GetCurrentThemeName(String&amp; themeFileName, String&amp; color, String&amp; size) in e:\dd\WPFOOB\src\wpfoob\WindowChrome\Microsoft.Windows.Shell\Standard\NativeMethods.cs:line 2795
     at Microsoft.Windows.Shell.SystemParameters2._InitializeThemeInfo() in e:\dd\WPFOOB\src\wpfoob\WindowChrome\Microsoft.Windows.Shell\SystemParameters2.cs:line 227
     at Microsoft.Windows.Shell.SystemParameters2..ctor() in e:\dd\WPFOOB\src\wpfoob\WindowChrome\Microsoft.Windows.Shell\SystemParameters2.cs:line 313
     at Microsoft.Windows.Shell.SystemParameters2.get_Current() in e:\dd\WPFOOB\src\wpfoob\WindowChrome\Microsoft.Windows.Shell\SystemParameters2.cs:line 347 
  </code></pre>