I think you want a post-build event.
It sounds like you already have the Project Dependency set up, which is good, because it's important that Project B gets built before Project A. And adding a Project Dependency for Project B, to Project A, is the way to do that.
Here's the documentation for adding/removing Project Dependencies: https://msdn.microsoft.com/en-us/library/et61xzb3.aspx
In Project A you can add a post build event that will copy the Project B exe.
- Right Click Project A, and choose "Properties".
- Change to the "Build Events" tab.
- Add the command:
copy "FromPath" "ToPath"
The documentation for the copy
command is here: https://technet.microsoft.com/en-gb/library/bb490886.aspx?f=255&MSPPError=-2147217396
If you click "Edit Post-build", you'll get a mini-editor which has a button labelled "Macros".
If you click that "Macros" button then it'll allow you to insert replacement strings in the format $(foo)
.
These macros allow you to get things like the project or solution folder, so you can easily build paths that point to the right places.
Here's some documentation on the build events: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-specify-build-events-csharp
Here's some (crappy) documentation on the Build Events properties page: https://learn.microsoft.com/en-us/visualstudio/ide/reference/build-events-page-project-designer-csharp
Here's some (useful) documentation on the macros: https://msdn.microsoft.com/en-us/library/c02as0cs.aspx