Post-build Event Command Line

How to write a command line argument in Post Build event in Visual Studio? To get to the setting, right click on project, select properties, then go to the third entry on left “Build Events”. Mostly like you will need to copy from one folder to another, you either hardcode the full path or use macros to accomplish the task. The macros can bee see on this Microsoft link

If the path of the project contains white spaces in directories, then use quotes to enclose the path name.

Example: copy “$(ProjectDir)SharedLibNhibernateRequired_Binssqlce*.dll” “$(ProjectDir)$(OutDir)”


$(ProjectDir) = The directory of the project (full path)
$(OutDir) = Path to the output file directory, relative to the project directory

This entry was posted in Software Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s