RibbonControlsLibrary XamlParseException问题VS 2010 [英] RibbonControlsLibrary XamlParseException issue VS 2010

查看:78
本文介绍了RibbonControlsLibrary XamlParseException问题VS 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RibbonControlsLibrary出现问题,从一开始我就无法在C#应用程序中使用这些控件.该问题是随机出现的,多数情况下是在重新启动后出现的.有时重新启动会有所帮助,并且它会开始正常运行(无需更改任何代码!).我测试了一些可能性,RibbonWindow控件起作用,直到将"Ribbon"控件放入代码中!错误也指向此控件. 最奇怪的是,当我创建新的WPF功能区应用程序时会出现该问题!实际上,代码是最简单的,但是仍然... 有人遇到这个问题吗?我试图用Google搜索它,但找不到任何有关此的信息.

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.

我有XP,因此操作系统阻止文件的问题不计算在内.

I have XP so problem with OS blocking file does not count.

XAML:

<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">
<DockPanel>
<r:Ribbon DockPanel.Dock="Top" Title="title">
</r:Ribbon>
</DockPanel>

</r:RibbonWindow>

vS给了我这个:

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& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.FetchResource(Object resourceKey, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
   at System.Windows.SystemResources.LookupResourceInDictionary(ResourceDictionary dictionary, Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
   at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& 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& 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& 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& 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& themeFileName, String& color, String& 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 

推荐答案

我的客户端在启动时抛出了相同的异常.

I had a client with the same exception thrown on startup.

事实证明,如果使用兼容性选项禁用视觉主题"启动了最简单的功能区应用程序,则该应用程序将正常崩溃.

It turned out that if the simplest ribbon application is launched with the compatibility option "Disable visual themes" then the application will gracefully crash.

在我们的例子中,功能区应用程序是通过另一个应用程序启动的. 在我们的客户端计算机上,最后一个是激活了兼容性选项.

In our case, the ribbon application is launched through another app. On our client machine, the last was having the compatibility option activated.

这篇关于RibbonControlsLibrary XamlParseException问题VS 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆