{"record":{"id":"37e19fdd3e1e777e","repo":"dotnet/wpf","slug":"0x80041703","errorCode":"0x80041703","errorMessage":"Filter does not have a working file. This is typically caused by a missing or failed call to IPersistFile::Load.","messagePattern":"Filter does not have a working file\\. This is typically caused by a missing or failed call to IPersistFile::Load\\.","errorType":"error_code","errorClass":"COMException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs","lineNumber":219,"sourceCode":"        /// On end of stream, this function will return null.\n        /// </remarks>\n        public ManagedChunk GetChunk()\n        {\n            if (!_filterContents)\n            {\n                // Contents not being filtered, no chunks to return in that case.\n                _currentContent = null;\n\n                // End of chunks.\n                return null;\n            }\n\n            IndexingContentUnit     contentUnit;\n\n            // If client code forgot to load the stream, throw appropriate exception.\n            if (_xamlReader == null)\n            {\n                throw new COMException(SR.FilterGetChunkNoStream, (int)FilterErrorCode.FILTER_E_ACCESS);\n            }\n\n            // If at end of chunks, report the condition.\n            if (_filterState == FilterState.EndOfStream)\n            {\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            {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs#L201-L237","documentation":"COMException from XamlFilter.GetChunk: the filter is asked for the next chunk, but its internal XamlReader is null because IPersistFile::Load was never called or failed, so there is no working XAML content to index. The message identifies the missing Load call as the cause.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call IPersistFile::Load on the filter (or IFilter initialization) before requesting chunks","Handle the COM error and return FILTER_E_ACCESS to the indexing client instead of propagating"],"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"}