Open AlexeyShirshov opened 7 years ago
I've faced with strange error I get on windows server 2012. System.Windows.Markup.XamlParseException: Задание свойства "FontAwesome.WPF.ImageAwesome.Icon" вызвало исключение. ---> System.Reflection.TargetInvocationException: Адресат вызова создал исключение. в System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) в System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo) в MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr) в MS.Internal.Text.TextInterface.Factory.GetFontCollection(Uri uri) в MS.Internal.FontCache.DWriteFactory.GetFontCollectionFromFileOrFolder(Uri fontCollectionUri, Boolean isFolder) в MS.Internal.FontCache.FamilyCollection.FromUri(Uri folderUri) в System.Windows.Media.FontFamily.LookupFontFamilyAndFace(CanonicalFontFamilyReference canonicalFamilyReference, FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.Typeface.ConstructCachedTypeface() в System.Windows.Media.Typeface.get_CachedTypeface() в System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Single pixelsPerDip, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit) в MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth, Double pixelsPerDip) в MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache) в MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) в System.Windows.Media.FormattedText.LineEnumerator.FormatLine(TextSource textSource, Int32 textSourcePosition, Double maxLineLength, TextParagraphProperties paraProps, TextLineBreak lineBreak) в System.Windows.Media.FormattedText.LineEnumerator.MoveNext() в System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics) в System.Windows.Media.FormattedText.Draw(DrawingContext dc, Point origin) в System.Windows.Media.DrawingContext.DrawText(FormattedText formattedText, Point origin) в FontAwesome.WPF.ImageAwesome.CreateImageSource(FontAwesomeIcon icon, Brush foregroundBrush, Double emSize) в FontAwesome.WPF.ImageAwesome.OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) в System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value) --- Конец трассировки внутреннего стека исключений --- в System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) в System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) в System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) в System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) в KX.CharterMaster.Diag2.zmKlOtQD67C43y0SSdO(Object , Object ) в KX.CharterMaster.Diag2.InitializeComponent() в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Diag2.xaml:строка 1 в KX.CharterMaster.Diag2..ctor() в KX.CharterMaster.Application.nHfG9eduq(Object , StartupEventArgs ) в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Application.xaml.vb:строка 241 в System.Windows.Application.OnStartup(StartupEventArgs e) в System.Windows.Application.<.ctor>b__1_0(Object unused) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
System.Windows.Markup.XamlParseException: Задание свойства "FontAwesome.WPF.ImageAwesome.Icon" вызвало исключение. ---> System.Reflection.TargetInvocationException: Адресат вызова создал исключение. в System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) в System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo) в MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr) в MS.Internal.Text.TextInterface.Factory.GetFontCollection(Uri uri) в MS.Internal.FontCache.DWriteFactory.GetFontCollectionFromFileOrFolder(Uri fontCollectionUri, Boolean isFolder) в MS.Internal.FontCache.FamilyCollection.FromUri(Uri folderUri) в System.Windows.Media.FontFamily.LookupFontFamilyAndFace(CanonicalFontFamilyReference canonicalFamilyReference, FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.Typeface.ConstructCachedTypeface() в System.Windows.Media.Typeface.get_CachedTypeface() в System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Single pixelsPerDip, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit) в MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth, Double pixelsPerDip) в MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache) в MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) в System.Windows.Media.FormattedText.LineEnumerator.FormatLine(TextSource textSource, Int32 textSourcePosition, Double maxLineLength, TextParagraphProperties paraProps, TextLineBreak lineBreak) в System.Windows.Media.FormattedText.LineEnumerator.MoveNext() в System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics) в System.Windows.Media.FormattedText.Draw(DrawingContext dc, Point origin) в System.Windows.Media.DrawingContext.DrawText(FormattedText formattedText, Point origin) в FontAwesome.WPF.ImageAwesome.CreateImageSource(FontAwesomeIcon icon, Brush foregroundBrush, Double emSize) в FontAwesome.WPF.ImageAwesome.OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) в System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value) --- Конец трассировки внутреннего стека исключений --- в System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) в System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) в System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) в System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) в KX.CharterMaster.Diag2.zmKlOtQD67C43y0SSdO(Object , Object ) в KX.CharterMaster.Diag2.InitializeComponent() в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Diag2.xaml:строка 1 в KX.CharterMaster.Diag2..ctor() в KX.CharterMaster.Application.nHfG9eduq(Object , StartupEventArgs ) в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Application.xaml.vb:строка 241 в System.Windows.Application.OnStartup(StartupEventArgs e) в System.Windows.Application.<.ctor>b__1_0(Object unused) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Here is the xaml `<Window x:Class="Diag2" 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:local="clr-namespace:KX.CharterMaster" mc:Ignorable="d" Title="Diag2" Height="300" Width="300" xmlns:fa="http://schemas.fontawesome.io/icons/"
`
If I comment <fa:ImageAwesome Icon="Flag" VerticalAlignment="Center" HorizontalAlignment="Center" /> program starts nurmaly.
<fa:ImageAwesome Icon="Flag" VerticalAlignment="Center" HorizontalAlignment="Center" />
Can you reformat the stack trace? It's very hard to read that way.
I've faced with strange error I get on windows server 2012.
System.Windows.Markup.XamlParseException: Задание свойства "FontAwesome.WPF.ImageAwesome.Icon" вызвало исключение. ---> System.Reflection.TargetInvocationException: Адресат вызова создал исключение. в System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) в System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo) в MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr) в MS.Internal.Text.TextInterface.Factory.GetFontCollection(Uri uri) в MS.Internal.FontCache.DWriteFactory.GetFontCollectionFromFileOrFolder(Uri fontCollectionUri, Boolean isFolder) в MS.Internal.FontCache.FamilyCollection.FromUri(Uri folderUri) в System.Windows.Media.FontFamily.LookupFontFamilyAndFace(CanonicalFontFamilyReference canonicalFamilyReference, FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(FontStyle& style, FontWeight& weight, FontStretch& stretch) в System.Windows.Media.Typeface.ConstructCachedTypeface() в System.Windows.Media.Typeface.get_CachedTypeface() в System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Single pixelsPerDip, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit) в MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded, Double pixelsPerDip) в MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth, Double pixelsPerDip) в MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache) в MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) в System.Windows.Media.FormattedText.LineEnumerator.FormatLine(TextSource textSource, Int32 textSourcePosition, Double maxLineLength, TextParagraphProperties paraProps, TextLineBreak lineBreak) в System.Windows.Media.FormattedText.LineEnumerator.MoveNext() в System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics) в System.Windows.Media.FormattedText.Draw(DrawingContext dc, Point origin) в System.Windows.Media.DrawingContext.DrawText(FormattedText formattedText, Point origin) в FontAwesome.WPF.ImageAwesome.CreateImageSource(FontAwesomeIcon icon, Brush foregroundBrush, Double emSize) в FontAwesome.WPF.ImageAwesome.OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) в System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) в System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) в System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) в System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value) в MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value) --- Конец трассировки внутреннего стека исключений --- в System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) в System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) в System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) в System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) в KX.CharterMaster.Diag2.zmKlOtQD67C43y0SSdO(Object , Object ) в KX.CharterMaster.Diag2.InitializeComponent() в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Diag2.xaml:строка 1 в KX.CharterMaster.Diag2..ctor() в KX.CharterMaster.Application.nHfG9eduq(Object , StartupEventArgs ) в F:\projects\mt\CharterMaster\CharterMaster.App\CharterMaster45\Application.xaml.vb:строка 241 в System.Windows.Application.OnStartup(StartupEventArgs e) в System.Windows.Application.<.ctor>b__1_0(Object unused) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Here is the xaml `<Window x:Class="Diag2" 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:local="clr-namespace:KX.CharterMaster" mc:Ignorable="d" Title="Diag2" Height="300" Width="300" xmlns:fa="http://schemas.fontawesome.io/icons/"
If I comment
<fa:ImageAwesome Icon="Flag" VerticalAlignment="Center" HorizontalAlignment="Center" />
program starts nurmaly.