{"record":{"id":"f405ba3cb2d5a8a0","repo":"dotnet/wpf","slug":"0x8004170c","errorCode":"0x8004170C","errorMessage":"<dynamic: xmlException.Message>","messagePattern":"<dynamic: xmlException\\.Message>","errorType":"error_code","errorClass":"COMException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs","lineNumber":242,"sourceCode":"            {\n                //Ensure _xamlReader has been closed\n                EnsureXmlReaderIsClosed();\n\n                // End of chunks.\n                return null;\n            }\n\n            try\n            {\n                contentUnit = NextContentUnit();\n            }\n            catch (XmlException xmlException)\n            {\n                //Ensure _xamlReader has been closed\n                EnsureXmlReaderIsClosed();\n\n                // Return FILTER_E_UNKNOWNFORMAT for ill-formed documents.\n                throw new COMException(xmlException.Message, (int)FilterErrorCode.FILTER_E_UNKNOWNFORMAT);\n            }\n\n            if (contentUnit == null)\n            {\n                // Update text information.\n                _currentContent = null;\n\n                //Ensure _xamlReader has been closed\n                EnsureXmlReaderIsClosed();\n\n                // Report end of stream by indicating end of chunks.\n                return null;\n            }\n\n            // Store the text for returning in GetText.\n            _currentContent = contentUnit.Text;\n\n            // Record the fact that GetText hasn't been called on this chunk.","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs#L224-L260","documentation":"COMException from XamlFilter.GetChunk: the underlying XmlReader threw an XmlException while reading the XAML content (ill-formed document). The filter closes its reader and rethrows with the original XML message text and FILTER_E_UNKNOWNFORMAT so the indexer treats the document as an unknown format.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the malformed XAML in the source document so it parses","Skip or exclude the invalid document from indexing by catching the COMException and returning FILTER_E_UNKNOWNFORMAT"],"exampleFix":null,"handlingStrategy":"try-catch","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"}