bcquality/microsoft/knowledge/style/al-build-output-must-not-pollute-project-root.md
Michael Dieringer cc7c1f2ee0 Address Jesper Schulz-Wedde's review on PR #156
- Rename 3 articles so their .good.al/.bad.al companion stems match
  (do-not-change-primary-key, testfield-required-setup-field,
  al-identifiers-english), fixing the R14 orphan-sample errors.
- do-not-change-primary-key.good.al: include Flow in the new table's
  own primary key so it actually models the discriminating dimension.
- al-build-output-must-not-pollute-project-root.md: drop the
  unsubstantiated AL0197 causal claim and the non-existent
  al.outputPath setting; reframe as build-artifact hygiene sourced
  from ALTool --outfolder / al_build outputPath.
- prefer-email-module.md: Email Message is Codeunit 8904, not a table;
  distinguish it from the underlying Sent/Outbox/Draft storage.
- file-datatype-saas.md: File.Open/Create/Read/Write fails to compile
  against a Cloud-scoped project, it does not compile and silently
  fail at runtime.
- namespace-must-be-verified-from-source.md: narrow to "resolve from
  the referenced object's source or symbols," since source-file line
  one is not the only authoritative source (symbol packages, comments
  before the namespace line).
- test-data-must-be-random-and-complete.md: drop "assume an empty
  database" and "collision-free" absolutes; reframe around
  independence from unrelated business records and reserving explicit
  values for scenario-defining inputs.
- binary-choice-must-be-boolean.md: scope to genuine true/false
  semantics, not mechanical two-member-enum-to-boolean conversion.
- document-report-word-layout.md: scope down to a sourced Microsoft
  Learn recommendation instead of an unconditional performance
  guarantee; cite the three Learn pages.
- Wire the new articles into their review skills' candidate-selection
  signals (file-datatype-saas, prefer-email-module,
  namespace-must-be-verified-from-source, var-parameters-require-an-
  addressable-variable) so they can actually enter a worklist.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 22:25:26 +02:00

1.5 KiB

bc-version domain keywords technologies countries application-area
all
style
build
output
alpackages
artifact-hygiene
outfolder
project-root
al
w1
all

Write AL Build Artifacts to an Intentional Output Location

Contributions welcome — open a PR to refine or extend this article.

Description

An AL project's compiled .app file can be written to the project root by default, and current tooling explicitly supports choosing a different destination instead — ALTool's --outfolder option and the al_build agent tool's outputPath parameter both exist for this. The problem this rule addresses is not that root-level output is technically invalid; it is agents leaving generated .app files scattered through arbitrary source locations, or treating a compiled artefact as if it were part of the source tree (committing it, editing around it, referencing it as a dependency by hand).

Best Practice

Write build artifacts to a deliberate, dedicated output location — configured via the build tool actually in use (e.g. ALTool --outfolder, or an explicit outputPath on the agent build tool) — and add that folder to .gitignore. Treat a compiled .app as a build artifact, never as a source file to commit or hand-edit around.

Anti Pattern

Letting .app files accumulate in arbitrary or unversioned locations without a deliberate output path, or committing compiled artefacts into source control alongside the AL files that produced them.