{"title":"AppSourceCop Hidden AS0074","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0074/","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-as0074, 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-as0074","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":"The attribute tag must be the same across branches.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Hidden AS0074","slug":"appsourcecop-hidden-as0074","at":0,"chars":5675},{"level":2,"title":"Description","slug":"description","at":81,"chars":133},{"level":2,"title":"Remarks","slug":"remarks","at":214,"chars":713},{"level":2,"title":"Setting up AppSourceCop to validate the Obsolete tag","slug":"setting-up-appsourcecop-to-validate-the-obsolete-tag","at":927,"chars":1113},{"level":3,"title":"Enabling the rule using a ruleset","slug":"enabling-the-rule-using-a-ruleset","at":983,"chars":799},{"level":3,"title":"Setting up the AppSourceCop.json","slug":"setting-up-the-appsourcecopjson","at":1782,"chars":258},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":2040,"chars":259},{"level":2,"title":"Example of code triggering this rule","slug":"example-of-code-triggering-this-rule","at":2299,"chars":952},{"level":3,"title":"Modifying the obsolete tag for an object that does not change obsolete state","slug":"modifying-the-obsolete-tag-for-an-object-that-does-not-change-obsolete-state","at":2585,"chars":666},{"level":2,"title":"Example of code not triggering this rule","slug":"example-of-code-not-triggering-this-rule","at":3251,"chars":2424},{"level":3,"title":"Preserving the obsolete tag for an object that does not change obsolete state","slug":"preserving-the-obsolete-tag-for-an-object-that-does-not-change-obsolete-state","at":3541,"chars":1235},{"level":3,"title":"Adding a tag for an obsolete object that didn't have one - higher than specified","slug":"adding-a-tag-for-an-obsolete-object-that-didnt-have-one---higher-than-specified","at":4776,"chars":899}],"text":"# AppSourceCop Hidden AS0074\nThe attribute tag must be the same across branches.\n## Description\nThe attribute tag must be the same across branches. This rule is only relevant only if the Major.Minor format is set.\n## Remarks\nThis rule verifies that the version specified as tag for ../attributes/devenv-obsolete-attribute or ../attributes/devenv-requiredpending-attribute attributes, or for objects that do not change state (not obsolete, obsolete pending, or obsolete removed), hasn't changed from the baseline.\nObjects or methods which don't have the same state as in the baseline are not validated by this rule, but are validated by appsourcecop-as0072.\n> NOTE\n> This rule is only enabled when using the default obsoleteTagPattern in the AppSourceCop.json file.\nThe version specified as obsoleteTagVersion can be the same as the current Major.Minor version specified in the version of your app.json, but it doesn't have to.\n## Setting up AppSourceCop to validate the Obsolete tag\n### Enabling the rule using a ruleset\nThe diagnostics for rule AS0074 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 AS0074 into an error.\n```json\n{\n    \"name\": \"My custom ruleset\",\n    \"rules\": [\n        {\n            \"id\": \"AS0074\",\n            \"action\": \"Error\",\n            \"justification\": \"Validating that obsolete tags are consistent with the baseline 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, it's recommended to enable the rules appsourcecop-as0072, appsourcecop-as0073, appsourcecop-as0074, appsourcecop-as0075, and appsourcecop-as0076.\n### Setting up the AppSourceCop.json\nTo enable the validation, you must specify the obsoleteTagVersion in the AppSourceCop.json file, but not specify the obsoleteTagPattern property to use the default pattern.\n```json\n{\n    \"obsoleteTagVersion\": \"2.0\"\n}\n```\n## How to fix this diagnostic?\nTo fix this diagnostic, make sure that all objects which did not change obsolete state in comparison to the baseline have an obsolete tag whose value is the one specified in the obsoleteTagVersion of the AppSourceCop.json file.\n## Example of code triggering this rule\nIn the following example, the AppSourceCop is run against a baseline which has version 1.0 and expects the obsolete tag version for objects changing obsolete states to be 2.0.\n```json\n{\n    \"version\": \"1.0\",\n    \"obsoleteTagVersion\": \"2.0\"\n}\n```\n### Modifying the obsolete tag for an object that does not change obsolete state\nVersion of the extension used as baseline:\n```al\ntable 50100 MyTable\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use table X instead.';\n    ObsoleteTag = '1.0';\n\n    fields\n    {\n        field(50100; MyField; Integer) { }\n    }\n}\n```\nCurrent version of the extension:\n```al\ntable 50100 MyTable\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use table X instead.';\n    ObsoleteTag = '2.0';\n\n    fields\n    {\n        field(50100; MyField; Integer) { }\n    }\n}\n```\nIn the current version of the extension, the obsolete tag has changed from 1.0 to 2.0, which isn't allowed.\n## Example of code not triggering this rule\nIn the following example, the AppSourceCop is run against a baseline which has version 1.0 and expects the obsolete tag version for objects changing obsolete states to be 2.0.\n```json\n{\n    \"version\": \"1.0\",\n    \"obsoleteTagVersion\": \"2.0\"\n}\n```\n### Preserving the obsolete tag for an object that does not change obsolete state\nVersion 1.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = '1.0';\n}\n\nVersion 2.0 of the extension:\n\n```AL\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = '1.0';\n}\n```\nThe codeunit was marked as obsolete pending in the baseline and its obsolete tag value doesn't change with the new version.\n### Adding a tag for an obsolete object that didn't have one - lower than specified\nVersion 1.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n}\n\nVersion 2.0 of the extension:\n\n```AL\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = '1.0';\n}\n```\nThe codeunit was marked as obsolete pending in the baseline without an obsolete tag. The new version of the extension specifies an obsolete version which is lower than the obsoleteTagVersion. This change is allowed by rule AS0074 to enable specifying tags without fixing the baselines.\n### Adding a tag for an obsolete object that didn't have one - higher than specified\nVersion 1.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n}\n\nVersion 2.0 of the extension:\n\n```AL\ncodeunit 50100 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use codeunit X instead.';\n    ObsoleteTag = '3.0';\n}\n```\nThe codeunit was marked as obsolete pending in the baseline without an obsolete tag. The new version of the extension specifies an obsolete version which is higher than the obsoleteTagVersion. This change is allowed by rule AS0074 to enable specifying tags without fixing the baselines. However, a diagnostic will be reported by appsourcecop-as0072.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}