Custom Target Authoring Patterns Canonical patterns from in the MSBuild repository. The Three-Level Target Chain Every major entry point (Build, Rebuild, Clean) delegates to a property listing its dependencies, which chains through Before → Core → After: delegates to and includes error handlers: Rules - Delegate to a property ( ), not hardcoded targets. - goes inside the orchestrating target to ensure cleanup runs even on failure. - Empty Before/After targets are extensibility points. Users override them; SDKs never put logic in them. Chain Extension — Append, Never Overwrite When adding a cu…