Reputation: 1028
I'm working on two projects in visual studio 2015 - one that produces a file (I'll call it "Generator"), and one that uses said file at runtime (I'll call it "Consumer").
I'm currently working on the file produced by Generator. In order to see how Consumer is affected after modification of Generator I have to:
I'd like to have all of this done in a single Ctrl+F5.
In the solution properties->startup project there is an option called "Current selection" that makes this tedious process a bit faster, but this is only a partial solution.
I tried to use "multiple startup projects", but this approach isn't for me - it runs these projects simultaneously and I want Consumer to wait until Generator is done.
In my most succesful approach I made a .bat that runs Generator and added it to one of build steps in Consumer (doesn't really matter what step - I used "prebuild event"). I also added Generator to Consumer's Build Dependencies. It works perfectly when I modify both Generator and Consumer. The problem appears when I modify Generator only - in such case build of Consumer doesn't trigger at all - which means that my bat file won't run Generator (I think that Consumer should be build, because dependent project was modifed).
My solution contains other projects, some of which take long time to build - I don't want to rebuild whole solution or any projects other that the two I was talking about.
Answer to this question isn't for me - I don't want to alter Consumer only to simplify the building process, because Generator is merely a utility to create some file used in the main program (Consumer). On the other hand I don't mind adding some additional projects.
If you know how to force project to be rebuild when it's dependency is out of date I'd be happy. If you know any other way to deal with my problem I'd be happy either.
Upvotes: 3
Views: 488
Reputation: 1028
I found a "how did I not think about it before?" kind of solution:
Since I want to run Generator after it's modification I in fact want to run it after it's build. So instead of trying to run it in Consumer's build i do this as Generator's Post-build Event.
Upvotes: 2