Project post-build event command to copy files to a local folder or network share in VS

I wanted to copy DLL files to a network share. I am dynamically loading assemblies in different applications and can not risk changing file paths.

I don’t want to mess up Visual Studio default binary locations. The work around is to do XCOPY in visual studio post build event;

XCOPY "$(TargetDir)*" "\\Netowrk Path\FolderName\" /S /Y

It’s that simple.

Resources

https://stackoverflow.com/questions/834270/visual-studio-post-build-event-copy-to-relative-directory-location

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7dc8f75f-596e-427a-9f6e-bd1a2408b9e6/post-build-command-to-copy-files?forum=visualstudiogeneral

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect