I am trying to get a one-time expensive goal to run only when creating a specific top-level project (which has many dependencies).
I have no problem getting this to work from a simple msbuild / command line build. I do this with customization and InitialTargets in a project or, alternatively, with
<BeforeBuild.jpg / p>
The tricky part is with Visual Studio. When I create the same project from VS. VS launches dependencies before even calling my .csproj, so my goal (which affects how other projects are built) does not start until they are already built.
Is there any way to get VS to complete the task before calling the dependencies?
I am currently working on this by launching the same costly goal from my lowest level project (one that is always under construction ...) using:
Condition = "$ (BuildingInsideVisualStudio)"
Any ideas on how to do this “right”? Again, I am looking for a solution that will work from VS.
source
share