{"title":"AppSourceCop Error AS0148","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0148/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0148, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0148","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"When transitioning an optional (default) interface method to required, the method must first be marked with [RequiredPending] in a prior version.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0148","slug":"appsourcecop-error-as0148","at":0,"chars":2114},{"level":2,"title":"Description","slug":"description","at":112,"chars":238},{"level":2,"title":"Remarks","slug":"remarks","at":350,"chars":916},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":1266,"chars":529},{"level":2,"title":"Related information","slug":"related-information","at":1795,"chars":319}],"text":"# AppSourceCop Error AS0148\nAn interface method was made required without first being marked [RequiredPending].\n## Description\nWhen transitioning an optional (default) interface method to required, the method must first be marked with [RequiredPending] in a prior version. This gives consumers advance notice before the breaking change takes effect.\n## Remarks\nThis error is raised when a default (optional) interface method in the baseline version has been changed to a required method (body removed) without first being marked with `[RequiredPending]`.\nMaking an optional method required is a breaking change for dependent extensions; the dependent extension must implement the method or it won't compile. The `[RequiredPending]` attribute provides a warning period so implementors can add their implementation before it becomes mandatory.\nThis rule enforces the two-phase lifecycle for interface methods:\n1. Phase 1: Add `[RequiredPending]` to the default method. Implementors receive a compiler warning (AL0924) but their code continues to compile.\n2. Phase 2: In a later major version, remove the body to make the method required.\nWhen both AS0148 and appsourcecop-as0149 fires on the same interface, AS0149 is suppressed because this error is more actionable.\n## How to fix this diagnostic?\nRestore the method's body (making it a default method again) and add the `[RequiredPending]` attribute:\n```al\ninterface IMyInterface\n{\n    [RequiredPending('This method will become required. Add your implementation now.', '26.0')]\n    procedure MyMethod(): Text\n    begin\n        exit('default');\n    end;\n}\n```\nIn a subsequent major version, you can remove the body and the attribute to make the method required.\nLearn more about the recommended lifecycle in ../devenv-interface-method-lifecycle.\n## Related information\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>\n../attributes/devenv-requiredpending-attribute\nAnalyzer rule AS0149<appsourcecop-as0149>\nAnalyzer rule AS0066<appsourcecop-as0066>\n../devenv-interface-method-lifecycle\nAppSourceCop analyzer<appsourcecop>"}