// TL;DR
Before you declare a task done: always run a build and verify there are no compile or build errors. Never call something "done" without this check.
Why the rule exists
Type errors, missing imports, and broken template references don't show up in a simple diff read. They surface only when the compiler runs. Hooks and CI catch them too — but by then it's too late: the user has already received a "done" message based on a false premise.
A local build typically takes 10–60 seconds. Skipping it costs far more when it means the user has to discover the problem themselves.
Stack-specific build commands
- .NET
dotnet build <solution.sln>— verify0 warnings, 0 errorsin the output.- Flutter
flutter analyze(zero issues), thenflutter build <platform>(zero warnings).- Blazor / ASP.NET
dotnet build— Blazor templates compile as part of the build, so Razor errors are caught here.- Node / Vite / npm
npm run buildfor prod compatibility, not justnpm run dev.- Static HTML
- Validate in browser: open the file, check the console for 404 / parse errors. (No "build" as such, but an open-and-verify test.)
Where build errors hide
- Missing using/import. A new class in a new namespace is only caught at build time.
- Type errors in Razor/Blazor templates. A wrong property name in
@bindisn't visible until the compiler chews through the template. - Resource references. A
<link href="missing.css">doesn't cause a build error, but a 404 in the browser at load time. - Migration conflicts. When you change an EF entity without updating the migration, it compiles fine but fails on the first DB touch.
Build first, tests after
Tests run on top of the build. If the build fails, tests fail for the wrong reasons — you're chasing a symptom instead of the cause. Always run the build to green first, then tests.
# Correct order dotnet build RestPartiDK.sln dotnet test # Green build first, then green tests
When the build says "done" but something is still wrong
A green build only says the code compiles — not that it works. Build-check is necessary, not sufficient. After a green build you still need to:
- Run tests (if there are any).
- Smoke-test the main flow manually (if it's a UI change).
- Check the browser console for 404 / runtime errors on frontend changes.
// Anti-pattern
"It compiled on my machine — I'm calling it done." If you haven't actually run the build in this session — only assumed it's fine — that isn't build-check. Run it explicitly every time.