My company develops .NET WPF apps (32-bit, targeting .NET Framework 4.7.2, and 4.5 for one of the old ones) written in C# using Visual Studio. My Windows 11 dev system installed updates last night, and today when I run any of our WPF apps (either under the Visual Studio debugger or standalone) they all crash with the same error: "System.IO.FileFormatException: StoryFragments part failed to load".
I initially thought the crash was due to code changes I had made, but eventually came to suspect it was due to the recent upgrades. I verified this by running the apps on another Windows 11 system and confirming that they ran just fine. I then installed the latest updates from the Windows Update part of the Settings app and rebooted the PC. After the reboot, when our apps are run they crash with the same error!
I then ran the same test on a Windows 10 system and got the same result - the app crashes with the same error!
My questions are:
- Has anyone else experienced this error?
- If so, is there a way to prevent it from occurring?
- Or is there a problem with a particular Windows updates that needs to be fixed?
Since the applications crash every time they are run, I am currently dead in the water as far as application development for my employer goes. So obviously I need a resolution to this problem ASAP.
If any of these updates happen to get installed on our sales staff PCs, then they will be unable to demo the applications for customers.
Fortunately we have a private Windows Update server for our deployed systems, so I've notified the person in charge of that to hopefully prevent any new updates from reaching those systems. Otherwise we'd be in a world of hurt!
Here are the Windows updates that were installed on the various systems:
Windows 10 PC
2022-12 Cumulative Update for Windows 10 Version 21H2 for x64-based Systems (KB5021233)
2022-12 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 21H2 for x64 9KB5021088)
Windows 11 PC #1
2022-12 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 11 for x64 (KB5021090)
2022-12 .NET 6.0.12 Security Update for x64 Client (KB5021954)
2022-12 .NET Core 3.1.32 Security Update for x64 Client (KB5021953)
2022-12 Cumulative Update for Windows 11 for x64-based Systems (KB5021234)
Windows 11 PC #2
2022-12 Cumulative Update for Windows 11 Version 22H2 for x64-based Systems (KB5021255)
2022-12 Cumulative Update for .NET Framework 3.5 and 4.8.1 for Windows 11, version 22H2 for x64 (KB5020880)
2022-12 .NET Core 3.1.32 Security Update for x64 Client (KB5021953)
2022-12 .NET 6.0.12 Security Update for x64 Client (KB5021954)
Here is the call stack from when one of our apps crashed:
2022-12-14 16:58:31.5440,Fatal,App,Fatal Exception,TruMed.AccuShelf.App.OnDispatcherUnhandledException,981,"System.IO.FileFormatException: StoryFragments part failed to load.
at System.Windows.Documents.FixedDocument.GetStoryFragments(FixedPage fixedPage)
at System.Windows.Documents.FixedTextBuilder.EnsureTextOMForPage(Int32 pageIndex)
at System.Windows.Documents.FlowPosition._xGetNextFlowNode()
at System.Windows.Documents.FlowPosition._vGetSymbolType(LogicalDirection dir)
at System.Windows.Documents.FixedTextPointer.System.Windows.Documents.ITextPointer.GetPointerContext(LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.xGetClingDSTP(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.xGapAwareGetSymbolType(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.GetPointerContext(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.System.Windows.Documents.ITextPointer.GetPointerContext(LogicalDirection direction)
at System.Windows.Documents.TextPointerBase.GetBorderingElementCategory(ITextPointer position, LogicalDirection direction)
at System.Windows.Documents.TextPointerBase.IsAtNormalizedPosition(ITextPointer position, Boolean respectCaretUnitBoundaries)
at System.Windows.Documents.TextPointerBase.IsAtNormalizedPosition(ITextPointer position, LogicalDirection direction, Boolean respectCaretUnitBoundaries)
at System.Windows.Documents.TextRangeBase.IsAtNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction)
at System.Windows.Documents.TextRangeBase.CreateNormalizedTextSegment(ITextRange thisRange, ITextPointer start, ITextPointer end)
at System.Windows.Documents.TextRangeBase.SelectPrivate(ITextRange thisRange, ITextPointer position1, ITextPointer position2, Boolean includeCellAtMovingPosition, Boolean markRangeChanged)
at System.Windows.Documents.TextRangeBase.Select(ITextRange thisRange, ITextPointer position1, ITextPointer position2, Boolean includeCellAtMovingPosition)
at System.Windows.Documents.TextRange..ctor(ITextPointer position1, ITextPointer position2, Boolean ignoreTextUnitBoundaries)
at System.Windows.Documents.TextSelection..ctor(TextEditor textEditor)
at System.Windows.Documents.TextEditor..ctor(ITextContainer textContainer, FrameworkElement uiScope, Boolean isUndoEnabled)
at System.Windows.Controls.Primitives.DocumentViewerBase.AttachTextEditor()
at System.Windows.Controls.Primitives.DocumentViewerBase.OnDocumentChanged()
at System.Windows.Controls.DocumentViewer.OnDocumentChanged()
at System.Windows.Controls.Primitives.DocumentViewerBase.DocumentChanged(IDocumentPaginatorSource oldDocument, IDocumentPaginatorSource newDocument)
at System.Windows.Controls.Primitives.DocumentViewerBase.DocumentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
at MS.Internal.Data.ClrBindingWorker.OnSourceInvalidation(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at TruMed.AccuShelf.App.<>c__DisplayClass69_0.<OnApplicationStartup>b__1() in C:\TS-475\AccuShelf\App\App\App.xaml.cs:line 885
at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at TruMed.AccuShelf.App.<OnApplicationStartup>d__69.MoveNext() in C:\TS-475\AccuShelf\App\App\App.xaml.cs:line 883
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Documents.FixedDocument.GetStoryFragments(FixedPage fixedPage)
at System.Windows.Documents.FixedTextBuilder.EnsureTextOMForPage(Int32 pageIndex)
at System.Windows.Documents.FlowPosition._xGetNextFlowNode()
at System.Windows.Documents.FlowPosition._vGetSymbolType(LogicalDirection dir)
at System.Windows.Documents.FixedTextPointer.System.Windows.Documents.ITextPointer.GetPointerContext(LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.xGetClingDSTP(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.xGapAwareGetSymbolType(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.GetPointerContext(DocumentSequenceTextPointer thisTp, LogicalDirection direction)
at System.Windows.Documents.DocumentSequenceTextPointer.System.Windows.Documents.ITextPointer.GetPointerContext(LogicalDirection direction)
at System.Windows.Documents.TextPointerBase.GetBorderingElementCategory(ITextPointer position, LogicalDirection direction)
at System.Windows.Documents.TextPointerBase.IsAtNormalizedPosition(ITextPointer position, Boolean respectCaretUnitBoundaries)
at System.Windows.Documents.TextPointerBase.IsAtNormalizedPosition(ITextPointer position, LogicalDirection direction, Boolean respectCaretUnitBoundaries)
at System.Windows.Documents.TextRangeBase.IsAtNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction)
at System.Windows.Documents.TextRangeBase.CreateNormalizedTextSegment(ITextRange thisRange, ITextPointer start, ITextPointer end)
at System.Windows.Documents.TextRangeBase.SelectPrivate(ITextRange thisRange, ITextPointer position1, ITextPointer position2, Boolean includeCellAtMovingPosition, Boolean markRangeChanged)
at System.Windows.Documents.TextRangeBase.Select(ITextRange thisRange, ITextPointer position1, ITextPointer position2, Boolean includeCellAtMovingPosition)
at System.Windows.Documents.TextRange..ctor(ITextPointer position1, ITextPointer position2, Boolean ignoreTextUnitBoundaries)
at System.Windows.Documents.TextSelection..ctor(TextEditor textEditor)
at System.Windows.Documents.TextEditor..ctor(ITextContainer textContainer, FrameworkElement uiScope, Boolean isUndoEnabled)
at System.Windows.Controls.Primitives.DocumentViewerBase.AttachTextEditor()
at System.Windows.Controls.Primitives.DocumentViewerBase.OnDocumentChanged()
at System.Windows.Controls.DocumentViewer.OnDocumentChanged()
at System.Windows.Controls.Primitives.DocumentViewerBase.DocumentChanged(IDocumentPaginatorSource oldDocument, IDocumentPaginatorSource newDocument)
at System.Windows.Controls.Primitives.DocumentViewerBase.DocumentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
at MS.Internal.Data.ClrBindingWorker.OnSourceInvalidation(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at TruMed.AccuShelf.App.<>c__DisplayClass69_0.<OnApplicationStartup>b__1() in C:\TS-475\AccuShelf\App\App\App.xaml.cs:line 885
at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at TruMed.AccuShelf.App.<OnApplicationStartup>d__69.MoveNext() in C:\TS-475\AccuShelf\App\App\App.xaml.cs:line 883
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)"