Saturday, September 13, 2008

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=\\qa1Srv\drops\publishedVers\ "

Targets="Publish" />
</Target>


From: http://vstskb.net/blog/2008/09/team-build-and-clickonce/

No comments: