{"record":{"id":"95c6986c5fd0f155","repo":"dotnet/wpf","slug":"sr-selectiondoesnotresolvetoapage-start","errorCode":null,"errorMessage":"SR.SelectionDoesNotResolveToAPage (start)","messagePattern":"SR\\.SelectionDoesNotResolveToAPage \\(start\\)","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs","lineNumber":99,"sourceCode":"        /// <exception cref=\"ArgumentNullException\">selection is null</exception>\n        /// <exception cref=\"ArgumentException\">selection is of wrong type</exception>\n        /// <exception cref=\"ArgumentException\">selection start or end point can not be resolved to a page</exception>\n        public override IList<DependencyObject> GetSelectedNodes(Object selection)\n        {\n            IList<TextSegment> textSegments = CheckSelection(selection);\n\n            IList<DependencyObject> pageEl = new List<DependencyObject>();\n\n            Point start;\n            Point end;\n            foreach (TextSegment segment in textSegments)\n            {\n                int startPage = int.MinValue;\n                ITextPointer startPointer = segment.Start.CreatePointer(LogicalDirection.Forward);\n                TextSelectionHelper.GetPointerPage(startPointer, out startPage);\n                start = TextSelectionHelper.GetPointForPointer(startPointer);\n                if (startPage == int.MinValue)\n                    throw new ArgumentException(SR.Format(SR.SelectionDoesNotResolveToAPage, \"start\"), nameof(selection));\n\n                int endPage = int.MinValue;\n                ITextPointer endPointer = segment.End.CreatePointer(LogicalDirection.Backward);\n                TextSelectionHelper.GetPointerPage(endPointer, out endPage);\n                end = TextSelectionHelper.GetPointForPointer(endPointer);\n                if (endPage == int.MinValue)\n                    throw new ArgumentException(SR.Format(SR.SelectionDoesNotResolveToAPage, \"end\"), nameof(selection));\n\n                int firstPage = pageEl.Count;\n                int numOfPages = endPage - startPage;\n\n                Debug.Assert(numOfPages >= 0, \"start page number is bigger than the end page number\");\n\n                // If the first page of this segment already has an FPP, then use that one for an additional segment\n                int i = 0;\n\n                if (pageEl.Count > 0 && ((FixedPageProxy)pageEl[pageEl.Count - 1]).Page == startPage)\n                {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs#L81-L117","documentation":"ArgumentException from FixedTextSelectionProcessor.GetSelectedNodes: the selection's start point cannot be resolved to a fixed-document page (GetPointerPage left the page number at its int.MinValue sentinel), so the start of the selection does not map to any FixedPage.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the selection lies within a fixed document (FlowDocument selections are not supported by this processor) before converting it to nodes","Trim the selection to a segment whose start resolves to a page, or re-acquire the selection after pagination completes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}