Search code examples
c#msbuildpost-build-eventjsmin

Using executable file from SVN on a post-build event


I am trying to use JSMin to compress Javascript on a .NET project, but since I don't want to create another dependency on the project I was wondering how could I have the executable file on my source control so that when building the project, so that I could "run" that executable on a post build event.

Any thoughts ?


Solution

  • If you work with Visual Studio 2010, you can select your project, then right click, select Properties. When the Properties tab opens, select "Build Events". In the "Post-build event command line", type your command, for example:

    c:\pathto\myprogram.exe dothis
    

    Please note that there are some built-in variables you can use in such case, for example: $(ProjectDir) and $(OutDir).

    But that can also be done in a MSBuild project as well.