简体   繁体   中英

Use external EXE as startup project

I have a solution which contains a few projects and an external exe. When I build, I want to copy the exe to my build folder, as well as build the projects and copy my dlls to the build folder. Is there any way to run this external exe as my post-build event? So, when I run my solution in visual studio, I would like to basically set the external exe as the startup project. Is this possible (or something similar)?

You don't want to run it while building, you want to run it when you start debugging. First get the .exe copied to the build directory with Project + Add Existing Item. Select the .exe. Set its Copy to Output Directory property to "Copy if newer". Build + Rebuild.

Then select it as your startup EXE with Project + Properties, Debug tab. Select the "Start external program" radio button and select the .exe in your bin\\debug directory. Press F5 to get it going with the debugger attached.

Add the EXE to your project as a file. right click the EXE properties. set "Copy to Output Directory" to "Copy Always"

Then in the properties of your project, under the Debug tab, set start external program and pick your EXE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM