{"record":{"id":"bf983d75e82a0e56","repo":"PrismLibrary/Prism","slug":"specified-method-is-not-supported","errorCode":null,"errorMessage":"Specified method is not supported.","messagePattern":"Specified method is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Modularity/ModuleManager.cs","lineNumber":31,"sourceCode":"    /// </summary>\n    protected IModuleCatalog ModuleCatalog { get; }\n\n    /// <summary>\n    /// Gets all the <see cref=\"IModuleInfo\"/> classes that are in the <see cref=\"IModuleCatalog\"/>.\n    /// </summary>\n    public IEnumerable<IModuleInfo> Modules => ModuleCatalog.Modules;\n\n    /// <summary>\n    /// Raised when a module is loaded or fails to load.\n    /// </summary>\n    public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted;\n\n    /// <summary>\n    /// Not used by Prism.Maui\n    /// </summary>\n    public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged\n    {\n        add => throw new NotSupportedException();\n        remove => throw new NotSupportedException();\n    }\n\n    /// <summary>\n    /// The module initializer.\n    /// </summary>\n    protected IModuleInitializer ModuleInitializer { get; }\n\n    /// <summary>\n    /// Initializes an instance of the <see cref=\"ModuleManager\"/> class.\n    /// </summary>\n    /// <param name=\"moduleInitializer\">Service used for initialization of modules.</param>\n    /// <param name=\"moduleCatalog\">Catalog that enumerates the modules to be loaded and initialized.</param>\n    public ModuleManager(IModuleInitializer moduleInitializer, IModuleCatalog moduleCatalog)\n    {\n        ModuleInitializer = moduleInitializer ?? throw new ArgumentNullException(nameof(moduleInitializer));\n        ModuleCatalog = moduleCatalog ?? throw new ArgumentNullException(nameof(moduleCatalog));\n    }","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Modularity/ModuleManager.cs#L13-L49","documentation":"ModuleManager.ModuleDownloadProgressChanged is an event whose add accessor throws NotSupportedException in Prism.Maui, because downloading module assemblies on demand is not supported on MAUI. Subscribing to the event (+=) throws 'Specified method is not supported.'","triggerScenarios":"moduleManager.ModuleDownloadProgressChanged += Handler; — any subscription attempt, typically code shared with or copied from Prism.Wpf where the event exists.","commonSituations":"Porting WPF Prism apps using download-on-demand modules to MAUI; shared helper classes that wire up module progress UI on all platforms.","solutions":["Remove the event subscription in MAUI code","Guard platform-specific code with #if directives or partial classes","Track module initialization progress via your own logging around ModuleManager.Run/LoadModule instead"],"exampleFix":"// before\nmoduleManager.ModuleDownloadProgressChanged += OnDownloadProgress;\n// after\n#if WINDOWS_WPF\nmoduleManager.ModuleDownloadProgressChanged += OnDownloadProgress;\n#endif","handlingStrategy":"type-guard","validationCode":"// guard before subscribing\nif (OperatingSystem.IsAndroid() || OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst())\n    return; // ModuleDownloadProgressChanged unsupported on MAUI\nmoduleManager.ModuleDownloadProgressChanged += OnProgress;","typeGuard":"bool SupportsDownloadEvents(object manager) => manager is not global::Prism.Maui.Modularity.ModuleManager;","tryCatchPattern":"try\n{\n    moduleManager.ModuleDownloadProgressChanged += OnProgress;\n}\ncatch (NotSupportedException)\n{\n    // Event not supported on MAUI — skip progress UI\n}","preventionTips":["Separate shared event wiring with #if directives per platform","Do not copy WPF module-download progress code into MAUI projects","Centralize platform-conditional module handling in one helper"],"tags":["unsupported-operation","modularity","maui","events"],"backgroundTag":"unsupported-operation","analyzedSha":"358118cd640d9a22ff8cf21c8ad197fa038b7990","analyzedAt":"2026-09-15T15:00:31.079Z","contentChangedAt":"2026-09-15T15:00:31.079Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}