Automatically Publishing DLLs

Less than one minute read time.

You are probably used to changing the build properties of a project and altering the output path that determines where the DLL gets created, as in the image below

But there is another way of handling the distribution of the DLL. Visual Studio has a useful feature called Pre-Build and Post-Build events. These can be used to include extra DOS commands before or after the build.

You can put any number of DOS commands in there to copy files, clean up directories, or even run tests.

You will find this in the Project, Build Events area.

The end product of this is a DOS batch file.

You can use the Macros to help populate the variables that you need to go in the batch file.

Note: There is no error checking except at the end of an event.