Post-build event command for publish (Visual Studio 2010)

一笑奈何 提交于 2019-11-30 12:59:04
Termiux

I recently faced a similar problem. I wanted to run a command 'only' if I published the application and not with every build.

I added a post publish task. Since I don't use MSBuild directly I modified my solution csproj file.

Example:

Solution Name: MyKillerApp

Project File name: MyKillerApp.csproj

Open the file with Notepad++ or other text editor and navigate to the end of the file and find this section(should be almost at the end):

  <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>

Then add your postpublish task

  <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>
  <Target Name="AfterPublish">
    <Exec Command="..\..\Documentation\DoxyGenExe\createDocs.bat" />
  </Target>

My task runs a bat file that runs Doxygen (a very nice docs creation program) and some other tasks.

You can create a bat file to run any commands is very handy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!