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
-
We have a use case where we want to run some pre-build or post-build logic for the entire solution. Is there a way to do this via an MSBuild Task? |
Beta Was this translation helpful? Give feedback.
Answered by
rainersigwald
Oct 19, 2022
Replies: 1 comment 2 replies
-
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 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
GangWang01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 theMSBuild
task to build a project that contains your pre-build logic.