0

I'm trying to create a pre build event similar to one described in this post

Build another project by prebuild event without adding reference

This is the command line I'm using in the Pre-build command line of the build events tab in Visual Studio 2015.

"$(DevEnvDir)devenv.exe" $(SolutionDir)MyFolder\SubFolder\MyProject.csproj /Rebuild "Debug|Any CPU"

However when I hit Build on the project that contains the pre-build event, it begins launching multiple instances of Visual Studio. I am watching the output directory for bin/Debug and it is conintually cleaning and rebulding the project, each time a new instance of Visual Studio is launched. None of the instances close. They remain running.

EDIT: I noticed even after cancelling the build in the IDE and exiting the IDE, the processes are still running and the debug folder is still being cleaned and updated with new dll's each time.

This is what my task manager looks like during the process

enter image description here enter image description here

Community
  • 1
  • 1
erotavlas
  • 4,274
  • 4
  • 45
  • 104
  • Can you be a bit more specific? Project A has the pre-build task, and the task says to rebuild Project B, yes? – Adam V Jan 20 '17 at 16:22
  • @AdamV yes that's right – erotavlas Jan 20 '17 at 16:26
  • 1
    Launching a new instance of Visual Studio to perform a build sounds like total overkill. If you just need to build your project, you can use MSBuild (http://stackoverflow.com/questions/1326445/is-there-a-good-tutorial-on-msbuild-scripts). Then you can you use a script to copy the output assemblies to where they need to go (ie your bin directory). – Philip Pittle Jan 20 '17 at 22:18
  • @PhilipPittle Ok your right, I switched to MSBuild, in my pre build event I used something like this and it works better "$(MSBuildBinPath)\msbuild.exe" $(SolutionDir)MyFolder\MySubFolder\MyProject.csproj /property:Configuration=Release – erotavlas Jan 23 '17 at 20:03
  • 1
    @erotavlas - Sounds like you answered your own question :) You should enter your solution as the answer and mark it correct. – Philip Pittle Jan 23 '17 at 21:43

0 Answers0