{"title":"AppSourceCop Hidden AS0076","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0076/","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-as0076, 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-as0076","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":"Attribute tag must have a specific format.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Hidden AS0076","slug":"appsourcecop-hidden-as0076","at":0,"chars":3107},{"level":2,"title":"Description","slug":"description","at":51,"chars":58},{"level":2,"title":"Remarks","slug":"remarks","at":109,"chars":387},{"level":2,"title":"Setting up AppSourceCop to validate the Obsolete Tag","slug":"setting-up-appsourcecop-to-validate-the-obsolete-tag","at":496,"chars":1425},{"level":3,"title":"Enabling the rule using a ruleset","slug":"enabling-the-rule-using-a-ruleset","at":552,"chars":783},{"level":3,"title":"Setting up the AppSourceCop.json","slug":"setting-up-the-appsourcecopjson","at":1335,"chars":586},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":1921,"chars":1039},{"level":2,"title":"Related information","slug":"related-information","at":2960,"chars":147}],"text":"# AppSourceCop Hidden AS0076\nAttribute tag format.\n## Description\nAttribute tag must have a specific format.\n## Remarks\nThe tag values for the ../attributes/devenv-obsolete-attribute and ../attributes/devenv-requiredpending-attribute attributes, and the ../properties/devenv-obsoletetag-property, are not validated by the AL compiler. However, you can set up the AppSourceCop to verify them using a Regex expression. The same obsoleteTagPattern applies to both Obsolete and RequiredPending tags.\n## Setting up AppSourceCop to validate the Obsolete Tag\n### Enabling the rule using a ruleset\nThe diagnostics for rule AS0076 are hidden by default, so you first have to use a ../devenv-rule-set-syntax-for-code-analysis-tools to surface them.\nFor example, the following ruleset turns the diagnostic for rule AS0076 into an error.\n```json\n{\n    \"name\": \"My custom ruleset\",\n    \"rules\": [\n        {\n            \"id\": \"AS0076\",\n            \"action\": \"Error\",\n            \"justification\": \"Validating that obsolete tags are formated properly is important\"\n        }\n    ]\n}\n```\n```json\n{\n    \"al.ruleSetPath\": \"custom.ruleset.json\"\n}\n```\n> NOTE\n> To fully validate obsolete properties and attributes, we recommend enabling the rules appsourcecop-as0072, appsourcecop-as0073, appsourcecop-as0074, appsourcecop-as0075, and appsourcecop-as0076.\n### Setting up the AppSourceCop.json\nBy default, the rule will validate that the specified obsolete tags are following the pattern `(\\\\d+)\\\\.(\\\\d+)`.\nHowever, it is possible to specify a custom pattern as a regular expression using the obsoleteTagPattern property in the AppSourceCop.json.\nThe property obsoleteTagPatternDescription can be used to provide a human readable version of the expected pattern.\nThe pattern description is used when reporting diagnostics.\n```json\n{\n    \"obsoleteTagPattern\": \"^[A-Z]{3}$\",\n    \"obsoleteTagPatternDescription\": \"Three upper case letters\"\n}\n```\n## How to fix this diagnostic?\nTo fix this diagnostic, make sure that your obsolete tags are matching the expected obsoleteTagPattern.\nFor instance, when using the default obsolete tag pattern, two diagnostics will be reported by rule AS0076 because the obsolete tag property and the obsolete tag attribute parameter values do not respect the format Major.Minor.\n```al\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = 'Next major';\n\n    [Obsolete('Use function Y instead', 'Next spring')]\n    procedure MyProcedure()\n    begin\n    end;\n}\n```\nThe code should be fixed a follows:\n```al\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = '17.0';\n\n    [Obsolete('Use function Y instead', '17.0')]\n    procedure MyProcedure()\n    begin\n    end;\n}\n```\n> NOTE\n> The version to specify when using the default obsolete tag pattern is validated by the rules appsourcecop-as0072 and appsourcecop-as0074.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}