Hi, I'm trying to get a one-time costly target to run only when building a certain top-level project (that has many dependencies).
I have no problem on getting this working from plain msbuild / command line build. I do this with setting and InitialTargets on the project, or alternatively with
< BeforeBuild />.
The tricky part is with Visual Studio. When I build the same project from VS. VS runs the dependencies before even invoking my .csproj, so my target (which affects how the other projects are built) doesn't get to run until they have already been built.
Is there someway to force VS to run a target before invoking the dependencies?
I'm currently working around this, by running the same costly target from my most low-level project (the one that get's always built...) by using:
Condition=" $(BuildingInsideVisualStudio) "
Any ideas on how to get this done "properly"? Again, I'm looking for a solution that will work FROM VS.