开发机器上运行完好,拷贝置目标机器上出现此问题

问题排查:

计算机-->管理-->事件查看器--->windows日志-->应用程序

Application Error  看不懂没啥用

打开.NET Runtime   查看程序异常信息

日志名称: Application
来源: .NET Runtime
日期: 2018/4/3 13:43:29
描述:
Application: WPFTestPage.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileFormatException
Stack:
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.Font.CreateFontFace()
at MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()
at MS.Internal.Text.TextInterface.Font.GetFontFace()
at System.Windows.Media.GlyphTypeface..ctor(MS.Internal.Text.TextInterface.Font)
at MS.Internal.FontFace.PhysicalFontFamily.GetGlyphTypeface(System.Windows.FontStyle, System.Windows.FontWeight, System.Windows.FontStretch)
at MS.Internal.FontFace.PhysicalFontFamily.MS.Internal.FontFace.IFontFamily.GetTypefaceMetrics(System.Windows.FontStyle, System.Windows.FontWeight, System.Windows.FontStretch)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(System.Windows.Media.TextFormatting.CharacterBufferRange, Double, Double, Double, Boolean, Boolean, System.Globalization.CultureInfo, System.Windows.Media.TextFormattingMode, Boolean, Boolean, Int32 ByRef)
at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(System.Windows.Media.TextFormatting.CharacterBufferRange, System.Windows.Media.TextFormatting.TextRun, MS.Internal.TextFormatting.TextFormatterImp, Int32, Boolean, Boolean)
at MS.Internal.TextFormatting.SimpleRun.Create(MS.Internal.TextFormatting.FormatSettings, System.Windows.Media.TextFormatting.CharacterBufferRange, System.Windows.Media.TextFormatting.TextRun, Int32, Int32, Int32, Int32, Int32)
at MS.Internal.TextFormatting.SimpleTextLine.Create(MS.Internal.TextFormatting.FormatSettings, Int32, Int32)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(System.Windows.Media.TextFormatting.TextSource, Int32, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(System.Windows.Media.TextFormatting.TextSource, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.Text.Line.Format(Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache, Boolean)
at System.Windows.Controls.TextBlock.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)
at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)
at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Window.MeasureOverrideHelper(System.Windows.Size)
at System.Windows.Window.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(System.Windows.Media.Visual)
at System.Windows.Interop.HwndSource.set_RootVisual(System.Windows.Media.Visual)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double, Double, Double, Double)
at System.Windows.Window.CreateSourceWindow(Boolean)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(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.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
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.LegacyInvokeImpl(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 SLCashierDesk.App.Main()

事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2018-04-03T05:43:29.000000000Z" />
<EventRecordID>2627</EventRecordID>
<Channel>Application</Channel>
<Computer>Z-PC</Computer>
<Security />
</System>
<EventData>
<Data>Application: WPFTestPage.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileFormatException
Stack:
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.Font.CreateFontFace()
at MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()
at MS.Internal.Text.TextInterface.Font.GetFontFace()
at System.Windows.Media.GlyphTypeface..ctor(MS.Internal.Text.TextInterface.Font)
at MS.Internal.FontFace.PhysicalFontFamily.GetGlyphTypeface(System.Windows.FontStyle, System.Windows.FontWeight, System.Windows.FontStretch)
at MS.Internal.FontFace.PhysicalFontFamily.MS.Internal.FontFace.IFontFamily.GetTypefaceMetrics(System.Windows.FontStyle, System.Windows.FontWeight, System.Windows.FontStretch)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(System.Windows.Media.TextFormatting.CharacterBufferRange, Double, Double, Double, Boolean, Boolean, System.Globalization.CultureInfo, System.Windows.Media.TextFormattingMode, Boolean, Boolean, Int32 ByRef)
at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(System.Windows.Media.TextFormatting.CharacterBufferRange, System.Windows.Media.TextFormatting.TextRun, MS.Internal.TextFormatting.TextFormatterImp, Int32, Boolean, Boolean)
at MS.Internal.TextFormatting.SimpleRun.Create(MS.Internal.TextFormatting.FormatSettings, System.Windows.Media.TextFormatting.CharacterBufferRange, System.Windows.Media.TextFormatting.TextRun, Int32, Int32, Int32, Int32, Int32)
at MS.Internal.TextFormatting.SimpleTextLine.Create(MS.Internal.TextFormatting.FormatSettings, Int32, Int32)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(System.Windows.Media.TextFormatting.TextSource, Int32, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(System.Windows.Media.TextFormatting.TextSource, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.Text.Line.Format(Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache, Boolean)
at System.Windows.Controls.TextBlock.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)
at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)
at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Window.MeasureOverrideHelper(System.Windows.Size)
at System.Windows.Window.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(System.Windows.Media.Visual)
at System.Windows.Interop.HwndSource.set_RootVisual(System.Windows.Media.Visual)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double, Double, Double, Double)
at System.Windows.Window.CreateSourceWindow(Boolean)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(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.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
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.LegacyInvokeImpl(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 SLCashierDesk.App.Main()
</Data>
</EventData>
</Event>

出现

Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileFormatException   IO异常 
说明使用了不存在的文件

继续查看异常信息

at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.Font.CreateFontFace()
at MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()
at MS.Internal.Text.TextInterface.Font.GetFontFace()

font 跟字体有关     ,经过排查 发现 开发机器上安装并且使用的字体,而目标机器上未安装字体文件 于是产生此错误!

WPF 使用字体引发的 CLR20r3 问题排查的更多相关文章

  1. Win10 中修改cmd字体引发的问题

    Win10 中修改cmd字体引发的问题 学习了:https://www.cnblogs.com/Diryboy/archive/2015/12/05/Use-Consolas-MSYaHei-in-C ...

  2. WPF下字体模糊的问题

    原文:WPF下字体模糊的问题 一直以来,发现WPF中的小字体下的文字变得比较模糊,比如: WPF与Winform字体显示比较: 为了看到更清楚,我们放大点显示:  放得更大些: 中文.日文等亚洲文字的 ...

  3. WPF矢量字体图标(iconfont)

    原文:WPF矢量字体图标(iconfont) 转载:点击打开链接 步骤: 一.下载添加iconfont文件 二.添加到资源文件夹,并设置不复制,且为资源文件 三.增加FIcon.xaml文件 < ...

  4. WPF 嵌入字体文件

    官方说明文档:将字体与应用程序一起打包 https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/advanced/packaging-fonts-w ...

  5. 聊聊WPF中字体的设置

    1. 今天帮同事调试一个字体的bug:TextBox中的中文显示大小不一致, 比如包含"杰","热". 原因是WPF针对点阵字体需要指定特定字体才能正确渲染, ...

  6. 一个字体引发的bug

    delphi 7 中默认字体样式为‘MS Sans Serif’,一般情况下子级控件会继承父级一些属性,其中包括字体(包括字体大小,字体样式,颜色等)属性.如果动态创建控件且需要修改字体颜色或者大小时 ...

  7. wpf设置字体颜色渐变和字体阴影

    <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment=&quo ...

  8. WPF 将字体文件 添加到 资源文件,并在后台代码使用

    先看结果 1.将字体文件,导入到资源文件,如: 添加后,自动生成 2.在窗体xaml中添加如: 3.在xaml窗体对应的cs文件中,为TextBlock指定字段 创建一个字段对象,并指定字体文件的所在 ...

  9. WPF使用字体图标

    首先我们要有字体文件,可以去阿里巴巴矢量图标库下载,下载解压后可以看到如下文件: 其中,iconfont.ttf就是字体文件,我们将该文件引入到自己的项目中,将iconfont.ttf文件的属性中&q ...

随机推荐

  1. [GraphQL] Use GraphQLList with GraphQLObject Types

    When working with collections of things in GraphQL, we'll always reach out for the GraphQLListType. ...

  2. 【14.06%】【hdu 5904】LCIS

    Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission ...

  3. 《从零開始学Swift》学习笔记(Day 71)——Swift与C/C++混合编程之数据类型映射

    原创文章.欢迎转载.转载请注明:关东升的博客 posted @ 2017-07-21 13:23 zhchoutai 阅读(...) 评论(...) 编辑 收藏

  4. Yii学习笔记之四(表单验证 api 翻译)

    1.表单验证 对于用户输入的全部数据,你不能信任,必须加以验证. 全部框架如此.对于yii 能够使用函数  yii\base\Model::validate()  进行验证 他会返回boolean值的 ...

  5. iptables 重启系统生效

    1. 重启系统生效 开启: chkconfig iptables on 关闭: chkconfig iptables off   2. 即时生效,重启后失效 开启: service iptables ...

  6. 【u030】扑克牌

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 组合数学是数学的重要组成部分,是一门研究离散对象的科学,它主要研究满足一定条件的组态(也称组合模型)的 ...

  7. BZOJ 3631 松鼠的新家 - 树链剖分 / 树上差分

    传送门 分析: 树链剖分:x->y,将x到y的路径加一,并将x端点的答案-1,最后统计答案. 树上差分:x->y,x+1,y+1,lca-1,fa[lca]-1,并将x打上标记,最后统计前 ...

  8. 【u216】A+B Problem(aplusb)

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 对于给定的A和B,求A+B的值. [输入格式] 输入文件aplusb.in的第1行为一个整数A,第2行 ...

  9. BZOJ 1864 三色二叉树 - 树型dp

    传送门 题目大意: 给一颗二叉树染色红绿蓝,父亲和儿子颜色必须不同,两个儿子颜色必须不同,问最多和最少能染多少个绿色的. 题目分析: 裸的树型dp:\(dp[u][col][type]\)表示u节点染 ...

  10. LUOGU 1137 - 拓扑排序

    传送门 题目分析 拓扑排序:将图从度为0的点不断的剥掉外层的点,即可得到拓扑序,再按照拓扑序进行一遍简单的dp. code #include<bits/stdc++.h> using na ...