run a custom msbuild target from VisualStudio

后端 未结 4 1025
清歌不尽
清歌不尽 2020-12-13 09:34

Suppose I add a custom target to a csproj file. Is there a way to run that target from visual studio? I don\'t want it make it a prebuild or postbuild step, I just want to

4条回答
  •  渐次进展
    2020-12-13 10:08

    You don't have to code with the Exec, although that is one way to do it. The easier way is to do the following:

    Change the DefaultTargets="Build" attribute to a custom Target you create, say "All" like so:

    DefaultTargets="All"
    

    Then in your custom "All" target, you can use the DependsOnTargets attribute, like the following:

    "
      "
    

    This will then build, and out put zip files in your custom "All" target.

提交回复
热议问题