Skip to content

Is there a way to run an MSBuild target before the first project or after the last project? #8074

Answered by rainersigwald
adcloeshelle asked this question in Q&A
Discussion options

You must be logged in to vote

Yes: https://learn.microsoft.com/visualstudio/msbuild/customize-your-build#customize-the-solution-build. However, it may not do what you want, since it doesn't apply in Visual Studio.

You may instead want to use a Directory.Build.targets to inject a target into every project, and inside that target use the MSBuild task to build a project that contains your pre-build logic.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@adcloeshelle
Comment options

@GangWang01
Comment options

Answer selected by GangWang01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #8072 on October 19, 2022 14:08.