Team Build and ClickOnce

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=\qa1SrvdropspublishedVers "
  Targets="Publish" />
</Target>
Advertisements

3 Responses to Team Build and ClickOnce

  1. Pingback: Team Build and ClickOnce - Maor David

  2. maord says:

    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 says:

    This comment originally written by:Team System NewsEugene Zakehareyev on Work Item customization tidbits: customization process (part 10 of x) and A Rule…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: