dotnet / dotnet/msbuild

Document common hook points for build extensions

Open
#10,143 2 comments 1 reaction 0 assignees View on GitHub
Area: Common Targets Area: Documentation backlog triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

We have https://learn.microsoft.com/visualstudio/msbuild/msbuild-targets#sdk-and-default-build-targets but it's not super clear, I think it'd be helpful to have more clear documentation for common use cases.

(https://mastodon.social/@mcc/112451423829765088)

Some examples

| Scenario | Hook point |
|--------|--------|
| "I just need to do something early in the build" | `BeforeTargets="BeforeBuild"` |
| "I need to modify the list of resolved references before anything uses it" | `AfterTargets="ResolveReferences"` |
| "I want to generate some C# source" | `BeforeTargets="BeforeCompile"` |
| "I have some files that I would want to add to `Content` or `None` to get copied to the output, but I generate them during the build" | `BeforeTargets="AssignTargetPaths"` |
| "I need to produce or change an output before this project is done" | `AfterTargets="AfterBuild"` |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.