# AppSourceCop Analyzer Rules
AppSourceCop is an analyzer that enforces rules that must be respected by extensions meant to be published to Microsoft AppSource.
## Rules
Id|Title|Category|Default severity
--|-----------|--------|----------------
appsourcecop-as0001|Tables and table extensions that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0002|Fields must not be deleted.|Upgrade|Error
appsourcecop-as0003|The previous version of the extension could not be found.|Upgrade|Error
appsourcecop-as0004|Fields must not change type, since dependent extensions may break|Upgrade|Error
appsourcecop-as0005|Fields must not change name|Upgrade|Error
appsourcecop-as0006|Tables that have been published must not change name.|Upgrade|Error
appsourcecop-as0007|Objects that have been published must not change namespace.|Upgrade|Error
appsourcecop-as0008|Defining reserved namespaces is not allowed.|Configuration|Error
appsourcecop-as0009|Key fields must not be changed|Upgrade|Error
appsourcecop-as0010|Keys must not be deleted|Upgrade|Error
appsourcecop-as0011|An affix is required|Extensibility|Error
appsourcecop-as0013|The field identifier must be within the allowed range|Extensibility|Error
appsourcecop-as0014|The project manifest must contain the allocated identifier range|Extensibility|Error
appsourcecop-as0015|TranslationFile must be enabled.|Extensibility|Error
appsourcecop-as0016|Fields of field class 'Normal' must use the DataClassification property and its value should be different from ToBeClassified|Extensibility|Error
appsourcecop-as0018|A procedure belonging to the public API cannot be removed|Upgrade|Error
appsourcecop-as0019|Event attributes cannot be removed|Upgrade|Error
appsourcecop-as0020|The type of events cannot be changed.|Upgrade|Error
appsourcecop-as0021|An argument in an event attribute cannot be changed to false.|Upgrade|Error
appsourcecop-as0022|An external scope cannot be removed|Upgrade|Error
appsourcecop-as0023|A return type cannot be modified in external procedures|Upgrade|Error
appsourcecop-as0024|Parameters cannot be removed or added in external procedures|Upgrade|Error
appsourcecop-as0025|Parameters cannot be modified, renamed, or removed from events.|Upgrade|Error
appsourcecop-as0026|The type and subtype of parameters cannot be modified in events and external procedures|Upgrade|Error
appsourcecop-as0027|Modifying the array size of a parameter in events and external procedures is not allowed|Upgrade|Error
appsourcecop-as0028|Reducing the array size of a parameter in events and external procedures is not allowed|Upgrade|Error
appsourcecop-as0029|Pages and PageExtensions that have been published must not be deleted, since dependent extensions may break|Upgrade|Error
appsourcecop-as0030|Pages that have been published must not be renamed.|Upgrade|Error
appsourcecop-as0031|Actions that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0032|Controls that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0033|Views that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0034|Unsupported table property change|Upgrade|Error
appsourcecop-as0035|Unsupported page property change|Upgrade|Warning
appsourcecop-as0036|Unsupported table field property change|Upgrade|Error
appsourcecop-as0038|Unsupported table key property change|Upgrade|Error
appsourcecop-as0039|Removing table properties that cause destructive changes is not allowed|Upgrade|Error
appsourcecop-as0040|Removing page properties that cause destructive changes is not allowed|Upgrade|Warning
appsourcecop-as0041|Table field property changes that cause destructive changes must not be removed|Upgrade|Error
appsourcecop-as0042|Table key property changes that cause destructive changes must not be removed|Upgrade|Error
appsourcecop-as0043|The clustered key must not be deleted|Upgrade|Error
appsourcecop-as0044|Property changes that cause destructive changes are not allowed|Upgrade|Error
appsourcecop-as0047|The extension name is too long.|Extensibility|Error
appsourcecop-as0048|The publisher name is too long.|Extensibility|Error
appsourcecop-as0049|The access modifier of an application object cannot be changed to a value that provides less access.|Extensibility|Error
appsourcecop-as0050|The extensibility of an application object cannot be removed|Extensibility|Error
appsourcecop-as0051|Manifest property is required for AppSource submission|Extensibility|Error
appsourcecop-as0052|The property 'url' must be set to a valid URL|Extensibility|Error
appsourcecop-as0053|The compilation target of an application must be a value that is allowed in a multi-tenant SaaS environment|Extensibility|Error
appsourcecop-as0054|The AppSourceCop configuration must specify the set of affixes used by the application|Configuration|Error
appsourcecop-as0055|The AppSourceCop configuration must specify the list of countries/regions targeted by the application|Configuration|Hidden
appsourcecop-as0056|The country/region codes specified in the 'supportedCountries' property must be valid ISO 3166-1 alpha-2 codes|Configuration|Warning
appsourcecop-as0057|Translations must be provided for all the locales in which the application will be available|Extensibility|Hidden
appsourcecop-as0058|Only use AssertError in Test Codeunits|Extensibility|Error
appsourcecop-as0059|Reserved database tables are read-only in a multi-tenant environment|Extensibility|Error
appsourcecop-as0060|Unsafe methods cannot be invoked in an AppSource application|Extensibility|Error
appsourcecop-as0061|Procedures must not subscribe to CompanyOpen events|Extensibility|Error
appsourcecop-as0062|Page controls and actions must use the ApplicationArea property|Extensibility|Error
appsourcecop-as0063|Removing a var modifier in events is not allowed|Upgrade|Error
appsourcecop-as0064|Interface implementations that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0065|Interfaces that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0066|A new method to an interface that has been published must not be added.|Upgrade|Error
appsourcecop-as0067|Adding an interface to an enum that has been published must have a default implementation.|Upgrade|Error
appsourcecop-as0068|Changing a table extension's target is not allowed.|Upgrade|Error
appsourcecop-as0069|An enum field replacing an option field should have at least the same number of members.|Upgrade|Error
appsourcecop-as0070|An enum field replacing an option field should preserve the member names.|Upgrade|Error
appsourcecop-as0071|An enum field replacing an option field should preserve the member ordinal values.|Upgrade|Error
appsourcecop-as0072|The attribute tag must be set to the next release version.|Design|Hidden
appsourcecop-as0073|Attribute tag must be set.|Design|Hidden
appsourcecop-as0074|The attribute tag must be the same across branches.|Design|Hidden
appsourcecop-as0075|Attribute reason must be set.|Design|Warning
appsourcecop-as0076|Attribute tag format.|Design|Hidden
appsourcecop-as0077|Adding a var modifier in events is not allowed|Upgrade|Error
appsourcecop-as0078|Adding or removing a var modifier in external procedures is not allowed|Upgrade|Error
appsourcecop-as0079|An affix is required for procedures defined in extension objects.|Extensibility|Warning
appsourcecop-as0080|Fields must not decrease in length|Upgrade|Error
appsourcecop-as0081|InternalsVisibleTo should not be used as a security feature.|Extensibility|Warning
appsourcecop-as0082|It is not allowed to rename an enum value.|Upgrade|Error
appsourcecop-as0083|It is not allowed to delete a value from an enum.|Upgrade|Error
appsourcecop-as0084|The ID range assigned to the extension must be within the allowed range|Extensibility|Error
appsourcecop-as0085|Use the 'application' property instead of specifying explicit dependencies.|Extensibility|Warning
appsourcecop-as0086|Fields must not increase in length|Upgrade|Warning
appsourcecop-as0087|Translations of enum value captions must not contain commas|Extensibility|Warning
appsourcecop-as0088|Objects with an ID that can be referenced and which have been published must not be deleted.|Upgrade|Error
appsourcecop-as0089|Objects that can be referenced and which have been published must not be deleted.|Upgrade|Error
appsourcecop-as0090|Objects that can be referenced and which have been published must not be renamed.|Upgrade|Error
appsourcecop-as0091|One or more dependencies of the previous version of the extension could not be found.|Upgrade|Error
appsourcecop-as0092|The app.json file must specify an Azure Application Insights resource.|Configuration|Warning
appsourcecop-as0094|Permission Sets should not be defined in XML files.|Configuration|Warning
appsourcecop-as0095|The access modifier of a table field cannot be changed to a value that provides less access.|Configuration|Error
appsourcecop-as0096|The name of an extension cannot be changed.|Configuration|Error
appsourcecop-as0097|The publisher name of an extension cannot be changed.|Configuration|Error
appsourcecop-as0098|An affix is needed.|Extensibility|Warning
appsourcecop-as0099|The member ID should be within the allowed range|Extensibility|Info
appsourcecop-as0100|The 'application' property must be specified in the app.json file.|Extensibility|Error
appsourcecop-as0101|The 'Isolated' argument cannot be changed, added, or removed.|Upgrade|Error
appsourcecop-as0102|Cannot add a return value to a procedure|Upgrade|Error
appsourcecop-as0103|Table definitions must have a matching permission set.|Configuration|Warning
appsourcecop-as0104|The extension name is not valid.|Extensibility|Error
appsourcecop-as0105|Object pending obsoletion contains an expired ObsoleteTag.|Design|Error
appsourcecop-as0106|A variable belonging to the public API cannot be removed.|Design|Error
appsourcecop-as0107|The access modifier of a variable that belongs to the public API cannot be changed to a value that provides less access.|Design|Error
appsourcecop-as0108|The type of a variable belonging to the public API cannot be changed.|Design|Error
appsourcecop-as0109|The type of the table has changed from Normal to Temporary.|Upgrade|Warning
appsourcecop-as0110|Permission set extensions should not include permissions for objects defined in another application.|Extensibility|Warning
appsourcecop-as0111|Permission set extensions should not include permission sets defined in another application.|Extensibility|Warning
appsourcecop-as0112|Permission set extensions should not include permission sets which include permissions for objects defined in another application.|Extensibility|Warning
appsourcecop-as0113|Permission set extensions should not include wildcard permissions.|Extensibility|Warning
appsourcecop-as0114|The name of an external business event cannot be changed.|Upgrade|Error
appsourcecop-as0115|The obsolete state cannot change directly from 'No' to 'Removed'.|Upgrade|Error
appsourcecop-as0116|Source application for the moved symbol cannot be found.|Upgrade|Warning
appsourcecop-as0117|Application object is moved without the use of PendingMove.|Upgrade|Error
appsourcecop-as0118|The length of a field part of the primary key cannot change.|Upgrade|Error
appsourcecop-as0119|The value of the MovedTo property in the source symbol does not match the destination AppId.|Upgrade|Error
appsourcecop-as0120|The value of the MovedFrom property in the destination object does not match the source AppId.|Upgrade|Error
appsourcecop-as0121|When a symbol is moved the name must remain the same.|Upgrade|Error
appsourcecop-as0122|Source symbol for the moved symbol cannot be found in the package with the given AppId.|Upgrade|Warning
appsourcecop-as0123|A key cannot be declared as clustered on an existing table.|Upgrade|Error
appsourcecop-as0124|Changing an extension object's target is not allowed.|Upgrade|Error
appsourcecop-as0125|Changes the XLIFF translation ID are not allowed.|Upgrade|Info
appsourcecop-as0126|InternalsVisibleTo should not specifying a different publisher name than the one of this extension.|Extensibility|Warning
appsourcecop-as0127|Objects should be placed in a namespace with at least two levels.|Extensibility|Warning
appsourcecop-as0128|An interface must not be removed from the the list of extended interfaces on an interface that has been published.|Upgrade|Error
appsourcecop-as0129|An interface must not be added to the the list of extended interfaces on an interface that has been published.|Upgrade|Error
appsourcecop-as0130|Avoid using duplicate object names|Extensibility|Warning
appsourcecop-as0131|Tables with schema should not be added.|Upgrade|Hidden
appsourcecop-as0132|Fields with schema should not be added.|Upgrade|Hidden
appsourcecop-as0133|Keys should not be added.|Upgrade|Hidden
appsourcecop-as0134|The version of an external business event cannot be changed.|Upgrade|Warning
appsourcecop-as0135|External business events must be marked obsolete before they can be removed.|Upgrade|Error
appsourcecop-as0136|Field IDs can only be changed with proper obsoletion.|Upgrade|Warning
appsourcecop-as0137|The ID of fields in the primary key cannot change.|Upgrade|Error
appsourcecop-as0138|Table fields should use the AllowInCustomizations property|Extensibility|Hidden
appsourcecop-as0139|New table fields must use the AllowInCustomizations property|Upgrade|Warning
appsourcecop-as0140|Analysis views that have been published must not be deleted.|Upgrade|Error
appsourcecop-as0141|A table that appears to be moved from another app must have the MovedFrom property.|Upgrade|Error
appsourcecop-as0142|The destination table must have the MovedFrom property.|Upgrade|Error
appsourcecop-as0146|Changing a field from Integer to BigInteger may break dependent extensions.|Upgrade|Warning
appsourcecop-as0147|Changing a parameter from Integer to BigInteger might break dependent extensions.|Upgrade|Warning
appsourcecop-as0148|An interface method was made required without first being marked [RequiredPending].|Upgrade|Error
appsourcecop-as0149|Adding or removing a required method on an interface may break dependent extensions at runtime.|Upgrade|Warning
appsourcecop-as0150|Fully-namespaced app objects must be in a compliant namespace|Extensibility|Error
appsourcecop-as0151|FullNamespaceScope conflicts with mandatory affix configuration|Extensibility|Info
appsourcecop-as0152|Removing a codeunit used as a default implementation is a runtime breaking change.|Upgrade|Warning
> NOTE
> Several rules enforced by the AppSourceCop analyzer are incompatible with rules enforced by the PerTenantExtensionCop. Make sure to enable only one of these at a time.
> NOTE
> Failing to comply with the rules whose default severity is set to Error will fail the submission of your extension to the AppSource marketplace. It is recommended, but not mandatory to comply with the rules whose severity is marked as Warning or Info. Rules with severity Hidden are related to very specific use cases and can be ignored.
## Configuration
The AppSourceCop analyzer can be further configured by adding a file named AppSourceCop.json in the project's root folder. The AL Language extension will offer IntelliSense for this file.
The following table describes the settings in the AppSourceCop.json file:
Setting|Mandatory|Value
name|No|The name of a previous version of this package with which you want to compare the current package for breaking changes.
publisher|No|The publisher of a previous version of this package with which you want to compare the current package for breaking changes.
version|Yes|The version of a previous version of this package with which you want to compare the current package for breaking changes.
mandatoryAffixes|No|Affixes that must be prepended or appended to the name of all new application objects, extension objects, and fields.
supportedCountries|No|The set of country codes, in the alpha-2 ISO 3166 format, in which the application will be available.
targetVersion|No|Specifies the next Major.Minor version of the extension in the current branch to validate the ObsoleteTag values with appsourcecop-as0072. This is only relevant when the default obsoleteTagPattern '(\\d+)\\.(\\d+)' is used. This property is being deprecated in favor of obsoleteTagVersion.
obsoleteTagVersion|No|Specifies the next Major.Minor version of the extension in the current branch to validate the ObsoleteTag values with AS0072. This is only relevant when the default obsoleteTagPattern '(\\d+)\\.(\\d+)' is used.
obsoleteTagPattern|No|The Obsolete tag pattern used by AS0076. This should be a valid regular expression. By default, the pattern '(\\d+)\\.(\\d+)' is used.
obsoleteTagPatternDescription|No|A human-readable description for the ObsoleteTagPattern regular expression. This is used in diagnostics reported by AS0076. By default, 'Major.Minor' is used.
obsoleteTagAllowedVersions|No|A comma-separated list of Major.Minor versions that will be allowed as ObsoleteTag values by appsourcecop-as0072. This is only relevant when the default obsoleteTagPattern '(\\d+)\\.(\\d+)' is used.
baselinePackageCachePath|No|The path to the folder containing the baseline and its dependencies with which you want to compare the current package for breaking changes. By default, the package cache path for the current project is used (see 'al.packageCachePath' setting).
obsoleteTagMinAllowedMajorMinor|No|The minimum version of ObsoleteTag (Major.Minor) allowed during compilation. Referencing an obsolete pending object with an obsolete tag lower than the specified version will trigger the rule appsourcecop-as0105. Note that enabling this setting has a performance impact.
sourceMovedObjectsPackagesCachePath|No|The path to the folder containing the packages from which tables or fields are moved to the current application. It should also contain their dependencies. If empty, move validation is disabled.
validateInternalSymbols|No|Specifies whether the breaking change validation should be enabled on internal symbols. By default, the validation of breaking changes is performed only on symbols that are part of the public API (except for schema breaking change validation which is always performed).
validateObsoleteSymbols|No|Specifies whether the breaking change validation should be enabled on symbols which are obsolete in the baseline. By default, the validation of breaking changes allows breaking change done on symbols which are obsolete in the baseline (except for schema breaking change validation which is always performed).
validateOnPremSymbols|No|Specifies whether the breaking change validation should be enabled on OnPrem symbols. By default, the validation of breaking changes is generally performed only on symbols with scope Cloud (except for schema breaking change validation which is always performed).
The name, publisher, version properties are used for specifying a previous version of the current package. This package must be located in the baseline package cache folder of your extension. This cache can be specified using the baselinePackageCachePath property. If this property is not specified, the dependency package cache path of the extension will be used instead. The al.packageCachePath setting allows you to specify the path to the folder that will act as the cache for the dependencies symbol files used by your project. AppSourceCop will compare the previous version of your extension with its current version and will report any breaking changes introduced by the current package.
The mandatoryAffixes property specifies strings that must be prepended or appended to the names of all new objects, extension objects and fields. By using these affixes, you can prevent clashes between objects added by your extension and objects added by other extensions.
The supportedCountries property specifies the codes that correspond to the countries/regions for which the product allows AppSource submissions. See Availability and supported Countries/Regions and Translations<../../compliance/apptest-countries-and-translations>
The properties obsoleteTagVersion, obsoleteTagPattern, and obsoleteTagPatternDescription can be used to enable additional validation on object obsoletion. These are not required for AppSource submissions.
## Example
In the following example, we will configure AppSourceCop to validate that all new elements have a name that contains one of the specified affixes.
> NOTE
> Make sure that code analysis is enabled and `${AppSourceCop}` is specified in the list of enabled code analyzers. For more information see AL Language Extension Configuration<../devenv-al-extension-configuration>.
We start by creating the default "Hello world" extension.
```al
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        begin
            Message('App published: Hello world');
        end;
    end;
}
```
We continue by adding the configuration file AppSourceCop.json in the project's root folder and setting its content to the following.
```json
{
    "mandatoryAffixes": [ "Foo", "Bar" ]
}
```
> IMPORTANT
> If you are running a multi-root workspace environment, you must have one AppSourceCop.json file in the root folder of each of the projects. See Working with multiple AL project folders within one workspace<../devenv-multiroot-workspaces>.
You are immediately greeted by the following error message:
```
AS0011: The identifier 'CustomerListExt' must have at least one of the mandatory affixes 'Foo, Bar'.
```
Prepending Foo to the name of the page extension object will fix this error and prevent clashes between this page extension and page extensions added by other developers.
> NOTE
> It is still possible to use the mandatoryPrefix and mandatorySuffix properties in the AppSourceCop.json. For more information see appsourcecop-as0011.
## Related information
../devenv-using-code-analysis-tool
../devenv-rule-set-syntax-for-code-analysis-tools
../devenv-using-code-analysis-tool-with-rule-set

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, 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. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop/
