Copy bin files on to Physical file location on Post Build event in VS2010

Praneeth picture Praneeth · Jan 12, 2011 · Viewed 39.1k times · Source

I want to copy my dll generated in bin folder to a file location on Post Build Event in vs2010.

Can some one help me on that.

Thanks

Answer

adrianbanks picture adrianbanks · Jan 12, 2011

You want to add something like:

xcopy /Q /Y "$(TargetPath)" "C:\path\to\somewhere\"

to you post-build event on the Build Events tab in the project properties page. The /Y will stop it from prompting you to confirm an overwrite.

If you also need to copy the .pdb file, you will need something like this:

xcopy /Q /Y "$(TargetDir)$(TargetName).*" "C:\path\to\somewhere\"

You can see more substitution tokens (the $XXX values) by clicking the Edit Post-build... button in the properties tab and then expanding the Macros>> button.