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

前端 未结 1 748
别跟我提以往
别跟我提以往 2021-01-02 05:32

I have a project in visual studio 2010. This project has the following post-build event command lines:

SET TARGET_PROJECT=TestMain
IF NOT EXIST \"$(TargetDir         


        
相关标签:
1条回答
  • 2021-01-02 06:13

    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

    0 讨论(0)
提交回复
热议问题