C# WPF:XamlParseException安装在XP上时,WPF应用程序中出现异常

C# WPF:XamlParseException安装在XP上时,WPF应用程序中出现异常,c#,wpf,xaml,windows-xp,xamlparseexception,C#,Wpf,Xaml,Windows Xp,Xamlparseexception,我有一个WPF应用程序,它在vista/7上运行得非常好,但在Windows XP上它抛出了System.Windows.Markup.XamlParse错误 我将Visual studio 2010与.NET 4.0、Telerik 2011年第2季度控件和DevXPress 2011控件一起使用 有关异常的详细信息: Application: CVServer.exe Framework Version: v4.0.30319 Description: The process was ter

我有一个WPF应用程序,它在vista/7上运行得非常好,但在Windows XP上它抛出了System.Windows.Markup.XamlParse错误

我将Visual studio 2010与.NET 4.0、Telerik 2011年第2季度控件和DevXPress 2011控件一起使用

有关异常的详细信息:

Application: CVServer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
at System.Windows.Markup.XamlReader.RewrapException(System.Exception,    System.Xaml.IXamlLineInfo, System.Uri)
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
at System.Windows.Application.LoadComponent(System.Uri, Boolean)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at Procesta.CvServer.App.Main() 

可能的问题可能是使用Segoe UI字体。XP未安装此字体

<FontFamily x:Key="ButtonFontFamily">Segoe UI</FontFamily>
Segoe用户界面
(将PresentationFramework.Aero设置为复制本地)Xaml代码?将其重新设置为标签引起的。还有-是否存在内部异常?您得到一个重写异常,但没有显示原始异常,这可能是XamlParseException的内部异常。您可以将ResourceDictionary.MergedDictionary粘贴到应用样式的位置吗?我解决了我的问题。它出现在Background=“{DynamicResource Background}”中。我换了一些静态资源。谢谢大家
Background="{DynamicResource Background}"
<FontFamily x:Key="ButtonFontFamily">Segoe UI</FontFamily>