{"record":{"id":"6f7590f7aa430852","repo":"dotnet/wpf","slug":"e-notimpl","errorCode":"E_NOTIMPL","errorMessage":"BindRegion is not implemented.","messagePattern":"BindRegion is not implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"info","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XpsFilter.cs","lineNumber":291,"sourceCode":"            if (_filter == null)\n            {\n                throw new COMException(SR.FileToFilterNotLoaded,\n                    (int)FilterErrorCode.FILTER_E_ACCESS);\n            }\n\n            return _filter.GetValue();\n        }\n\n        /// <summary>\n        /// Retrieves an interface representing the specified portion of the object.\n        /// </summary>\n        /// <param name=\"origPos\"></param>\n        /// <param name=\"riid\"></param>\n        /// <returns>Not implemented. Reserved for future use.</returns>\n        IntPtr IFilter.BindRegion([In] FILTERREGION origPos, [In] ref Guid riid)\n        {\n            // The following exception maps to E_NOTIMPL.\n            throw new NotImplementedException(SR.FilterBindRegionNotImplemented);\n        }\n\n        #endregion IFilter methods\n\n        #region IPersistFile methods\n\n        /// <summary>\n        /// Return the CLSID for the XAML filtering component.\n        /// </summary>\n        /// <param name=\"pClassID\">On successful return, a reference to the CLSID.</param>\n        void IPersistFile.GetClassID(out Guid pClassID)\n        {\n            pClassID = _filterClsid;\n        }\n\n        /// <summary>\n        /// Return the path to the current working file or the file prompt (\"*.xps\").\n        /// </summary>","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XpsFilter.cs#L273-L309","documentation":"XpsFilter intentionally does not implement IFilter.BindRegion; calling it always throws NotImplementedException, which COM interop maps to E_NOTIMPL. BindRegion is reserved for moniker-based linking and is not meaningful for XPS package filtering.","triggerScenarios":"Any call to IFilter.BindRegion on an XpsFilter instance, e.g. by indexers attempting to bind a FILTERREGION to an interface.","commonSituations":"Search/index infrastructure that generically calls all IFilter methods, or code ported from filters that support BindRegion.","solutions":["Do not call BindRegion on XpsFilter — treat E_NOTIMPL as 'not supported' and continue","Gate generic IFilter code so BindRegion is only invoked on filters that advertise support","Handle NotImplementedException/E_NOTIMPL gracefully in indexing loops"],"exampleFix":"// before\nvar result = ((IFilter)filter).BindRegion(origPos, ref riid);\n// after\ntry { result = ((IFilter)filter).BindRegion(origPos, ref riid); }\ncatch (NotImplementedException) { /* not supported — proceed without binding */ }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { filter.BindRegion(origPos, ref riid); }\ncatch (NotImplementedException) { /* expected: XpsFilter never supports BindRegion */ }","preventionTips":["Treat E_NOTIMPL from IFilter methods as an expected 'unsupported' result","Never build functionality that depends on BindRegion for XPS content","Read the IFilter implementation docs before invoking optional methods"],"tags":["wpf","xps","ifilter","com","unsupported"],"backgroundTag":"method-not-implemented","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}