# Compilation scope overview
In Business Central, there are different layers to manage what can be published to the server and accessed from within a project.
## Configure extension target on the server
By setting the ExtensionAllowedTargetLevel flag in the server configuration, you control what can be published to the server by setting the Cloud or OnPrem flag. See Configuring Business Central server<../administration/server-instance-settings>.
## Configure extension target for an extension
In the manifest of an extension (the app.json file), you can set the target property to specify the compilation target of an extension. The available values are OnPrem and Cloud.
The target property informs the compiler, which APIs can be used within the current project. The following rules apply:
 If you specify `"target":"OnPrem"`, you can use any platform APIs and .NET types. This is the most permissive target. It's only if you specify this target, that you can use methods marked with `Scope('OnPrem')` or tables with the property properties/devenv-scope-table-property set to OnPrem.
 If you specify `"target":"Cloud"`, you can only use APIs that are safe for use in a cloud environment. If the target is set to Cloud, the extension can't use any method marked with `Scope('OnPrem')` or table with the property Scope set to the OnPrem. For example, if you have two extensions; A and B. Extension A has an app.json target setting `"target": "OnPrem"` and defines a method with the attributes/devenv-scope-attribute set to `[Scope('OnPrem')]`. Extension B has a dependency on extension A and extension B has an app.json target setting `"target": "Cloud"` and tries to call the method in extension A marked with scope OnPrem, you get a compile error when you're trying to compile extension B. See devenv-json-files.
> NOTE
> A table with the property Scope set to OnPrem carries this scope forward to every other object that might refer it as SourceTable, even if those elements are declared within the same extension. <br>
## Methods and tables scope
Methods can be marked with the `[Scope()]` attribute to specify the compilation target and tables can be marked with the Scope property. Both instruct the compiler, which targets the method or table can be used in. See attributes/devenv-scope-attribute and properties/devenv-scope-table-property.
## Related information
AL development environment<devenv-reference-overview>
Developing extensions in AL<devenv-dev-overview>
devenv-json-files
attributes/devenv-scope-attribute
properties/devenv-scope-table-property
Configuring Business Central server<../administration/configure-server-instance>

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/devenv-compilation-scope-overview, 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/devenv-compilation-scope-overview/
