{"title":"AppSourceCop Error AS0078","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0078/","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-as0078, 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-as0078","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":"Adding or removing a var modifier in public procedures is not allowed as it might break the runtime behavior of extensions calling it.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0078","slug":"appsourcecop-error-as0078","at":0,"chars":1296},{"level":2,"title":"Description","slug":"description","at":100,"chars":150},{"level":2,"title":"Remarks","slug":"remarks","at":250,"chars":617},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":867,"chars":282},{"level":2,"title":"Related information","slug":"related-information","at":1149,"chars":147}],"text":"# AppSourceCop Error AS0078\nAdding or removing a var modifier in external procedures is not allowed\n## Description\nAdding or removing a var modifier in public procedures is not allowed as it might break the runtime behavior of extensions calling it.\n## Remarks\nThis error ensures that the behavior of public procedures remains consistent and predictable. Adding or removing a var modifier can significantly change how parameters are handled within a procedure. Extensions that call these procedures may rely on the original parameter passing mechanism (by value or by reference). Altering this mechanism can cause compatibility issues, runtime errors, and unexpected behavior in these extensions. Maintaining the original parameter passing mechanism ensures that the procedure's behavior remains stable and that dependent extensions continue to function as expected.\n## How to fix this diagnostic?\nTo resolve this error, follow these steps:\n1. Locate the public procedure in your code where the var modifier has been added or removed from a parameter.\n2. Modify the procedure definition to restore the original var modifier status of the parameter.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}