Skip to content

MS.Internal.Invariant.get_IsDialogOverrideEnabled() can throw NullReferenceException #6772

@VladimirKhil

Description

@VladimirKhil
  • .NET Core Version: 6.0

I have only the exception stack trace collected automatically from one of my clients. No other system information is available.

I hope that this stack trace would be useful for some research.

According to sources, IsDialogOverrideEnabled could throw NRE if registry key "Software\Microsoft\.NETFramework" is missing on the machine.

System.NullReferenceException: Object reference not set to an instance of an object. at bool MS.Internal.Invariant.get_IsDialogOverrideEnabled() at void MS.Internal.Invariant.Assert(bool condition) at IFontFamily System.Windows.Media.FontFamily.get_FirstFontFamily() at double System.Windows.Media.FontFamily.get_LineSpacing() at double System.Windows.Controls.TextBox.GetLineHeight() at void System.Windows.Controls.TextBox.SetScrollViewerMinMaxHeight() at Size System.Windows.Controls.TextBox.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.DockPanel.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.DockPanel.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at Size System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size Microsoft.Windows.Themes.ClassicBorderDecorator.MeasureOverride(Size availableSize) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.Grid.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at void System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) at void System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) at Size System.Windows.Controls.Grid.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.Control.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at void System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) at void System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) at Size System.Windows.Controls.Grid.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.Grid.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at Size System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.Border.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size System.Windows.Controls.Control.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at Size MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at Size System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at Size System.Windows.FrameworkElement.MeasureCore(Size availableSize) at void System.Windows.UIElement.Measure(Size availableSize) at void System.Windows.ContextLayoutManager.UpdateLayout() at object System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) at void System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at void System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) at object System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget) at object System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, object args, int numArgs) at object System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, Delegate callback, object args, int numArgs, Delegate catchHandler)

Metadata

Metadata

Labels

BugProduct bug (most likely)InvestigateRequires further investigation by the WPF team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions