The other day I got a question: How can I deploy an app via ClickOnce using Team Build?

There is not out of box way to do that, but we can do it with a simple workaround:

we should overload the target AfterCompile in TFSBuild.Proj to call MSBuild Task Publish and can pass the PublishDir property:

<Target Name="AfterCompile">
  <MSBuild
  Condition=" '@(SolutionToBuild)'!='' "
  Projects="@(SolutionToBuild)"
  Properties="Configuration=%(ConfigurationToBuild.FlavorToBuild);
    Platform=%(ConfigurationToBuild.PlatformToBuild);
    SkipInvalidConfigurations=true;
    VCBuildOverride=$(MSBuildProjectDirectory)\TFSBuild.vsprops;
    FxCopDir=$(FxCopDir);OutDir=$(OutDir);
    PublishDir=$(OutDir);
    ReferencePath=$(ReferencePath);
    TeamBuildConstants=$(TeamBuildConstants);
    $(CodeAnalysisOption);PublishDir=\\qa1Srv\drops\publishedVers\ "
  Targets="Publish" />
</Target>

Similar Posts:

Tags: ,



3 Comments to “Team Build and ClickOnce”

  1. Team Build and ClickOnce - Maor David | September 13th, 2008 at 00:56

    [...] http://vstskb.net/blog/2008/09/team-build-and-clickonce/ Filed under: MSBuild, Team [...]

  2. maord | June 22nd, 2009 at 23:05

    This comment originally written by:
    The other day I got a question: How can I deploy an app via ClickOnce using Team Build? There is not out of box way to do that, but we can do it with a simple workaround: we should overload the target AfterCompile in TFSBuild.Proj to call MSBuild Task

  3. maord | June 22nd, 2009 at 23:05

    This comment originally written by:Team System News

    Eugene Zakehareyev on Work Item customization tidbits: customization process (part 10 of x) and A Rule…

Leave a Comment