0

I have several build configurations and depending on the configuration chosen, I need to copy the dll to a created folder. Basically, my executable is located on c:\project and my dll is in c:\library. I need to setup a post-buildevent on the dll so that it creates a folder called custom in the c:\project executable directory and then copy the dll to this custom folder. How do I accomplish the above? One thing I have noticed is that a post-build event on the dll does not give me access to the executables directory and I don't want to have to hard code something like c:\project\bin\debug for example.

Xaisoft
  • 45,655
  • 87
  • 279
  • 432
  • You need to ask a question. – Hans Passant Nov 28 '12 at 20:00
  • It seems that just creating a batch file that is called from the post-build event could do that. Or is there some complexity involved that prevents this from working? – Mark Wilkins Nov 28 '12 at 20:00
  • @HansPassant - My question is I am not sure how to do it? Updated anyways. – Xaisoft Nov 28 '12 at 20:02
  • Example: http://stackoverflow.com/questions/3497989/how-to-change-the-location-that-the-references-dlls-are-copied-to/3498184#3498184 – Hans Passant Nov 28 '12 at 20:07
  • @HansPassant - In your example, is that post-build event on the executable target path? – Xaisoft Nov 28 '12 at 20:08
  • $(TargetDir) is a macro for the target directory. – Hans Passant Nov 28 '12 at 20:09
  • @HansPassant - But I need to copy from one target directory to another? The dll I need to copy is not in the bin folder of the executbale. – Xaisoft Nov 28 '12 at 20:12
  • A project has only one target directory. It cannot guess where the file is supposed to come from, you'll need to help. This is otherwise solved by having the projects in a solution, the build results go into the solution folder. – Hans Passant Nov 28 '12 at 20:23

0 Answers0