Umbraco Visual Studio Development Tip - post-build events

visual studio tip

Posted on Tuesday, August 20, 2013

When developing for umbraco either user controls or surface cotrollers, there is a lot of "copy and pasting files" Using visual studio "post-build event command line" we can execute the XCOPY after a successful build: for example (for user control):

C:\Windows\System32\XCOPY "$(ProjectDir)bin\$(TargetName).dll" C:\projects\umbraco\bin" /Y
C:\Windows\System32\XCOPY "$(ProjectDir)*.ascx" "C:\projects\umbraco\usercontrols" /Y

You can access the "post-build event command line" selecting "Properties" of the project and click on "Build Events" (note: I had to reference XCOPY with full path otherwise I recieved a "xcopy exit with code 9009 in Visual Studio post-build" - (thanks to Ken Van Gilbergen for the pointer)